本文整理汇总了Java中com.amazonaws.services.s3.model.EncryptionMaterialsProvider类的典型用法代码示例。如果您正苦于以下问题:Java EncryptionMaterialsProvider类的具体用法?Java EncryptionMaterialsProvider怎么用?Java EncryptionMaterialsProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EncryptionMaterialsProvider类属于com.amazonaws.services.s3.model包,在下文中一共展示了EncryptionMaterialsProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: provideAmazonS3Client
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
@Singleton
@Provides
@Nullable
public AmazonS3 provideAmazonS3Client(@Nullable AWSCredentials awsCredentials, @Nullable EncryptionMaterialsProvider encryptionMaterialsProvider)
{
if (awsCredentials == null) {
if (encryptionMaterialsProvider == null) {
return new AmazonS3Client(new InstanceProfileCredentialsProvider());
}
else {
return new AmazonS3EncryptionClient(new InstanceProfileCredentialsProvider(), encryptionMaterialsProvider);
}
}
if (encryptionMaterialsProvider == null) {
return new AmazonS3Client(awsCredentials);
}
else {
return new AmazonS3EncryptionClient(awsCredentials, encryptionMaterialsProvider);
}
}
开发者ID:airbnb,项目名称:airpal,代码行数:22,代码来源:AirpalModule.java
示例2: AmazonS3EncryptionClient
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* @deprecated use {@link AmazonS3EncryptionClientBuilder#withEncryptionMaterials(EncryptionMaterialsProvider)} and
* {@link AmazonS3EncryptionClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonS3EncryptionClientBuilder#withCryptoConfiguration(CryptoConfiguration)} and
* {@link AmazonS3EncryptionClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonS3EncryptionClientBuilder#withMetricsCollector(RequestMetricCollector)} and
* {@link AmazonS3EncryptionClientBuilder#withKmsClient(AWSKMS)}
*/
@Deprecated
public AmazonS3EncryptionClient(AWSKMSClient kms,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider kekMaterialsProvider,
ClientConfiguration clientConfig,
CryptoConfiguration cryptoConfig,
RequestMetricCollector requestMetricCollector) {
super(credentialsProvider, clientConfig, requestMetricCollector);
assertParameterNotNull(kekMaterialsProvider,
"EncryptionMaterialsProvider parameter must not be null.");
assertParameterNotNull(cryptoConfig,
"CryptoConfiguration parameter must not be null.");
this.isKMSClientInternal = kms == null;
this.kms = isKMSClientInternal
? newAWSKMSClient(credentialsProvider, clientConfig, cryptoConfig,
requestMetricCollector)
: kms;
this.crypto = new CryptoModuleDispatcher(this.kms, new S3DirectImpl(),
credentialsProvider, kekMaterialsProvider, cryptoConfig);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:29,代码来源:AmazonS3EncryptionClient.java
示例3: createEncryptionMaterialsProvider
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
private static EncryptionMaterialsProvider createEncryptionMaterialsProvider(Configuration hadoopConfig)
{
String empClassName = hadoopConfig.get(S3_ENCRYPTION_MATERIALS_PROVIDER);
if (empClassName == null) {
return null;
}
try {
Object instance = Class.forName(empClassName).getConstructor().newInstance();
if (!(instance instanceof EncryptionMaterialsProvider)) {
throw new RuntimeException("Invalid encryption materials provider class: " + instance.getClass().getName());
}
EncryptionMaterialsProvider emp = (EncryptionMaterialsProvider) instance;
if (emp instanceof Configurable) {
((Configurable) emp).setConf(hadoopConfig);
}
return emp;
}
catch (ReflectiveOperationException e) {
throw new RuntimeException("Unable to load or create S3 encryption materials provider: " + empClassName, e);
}
}
开发者ID:y-lan,项目名称:presto,代码行数:23,代码来源:PrestoS3FileSystem.java
示例4: provideEncryptionMaterialsProvider
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
@Nullable
@Singleton
@Provides
private EncryptionMaterialsProvider provideEncryptionMaterialsProvider()
{
String empClassName = config.getS3EncryptionMaterialsProvider();
if (empClassName != null) {
try {
Class<?> empClass = Class.forName(empClassName);
Object instance = empClass.newInstance();
if (instance instanceof EncryptionMaterialsProvider) {
return (EncryptionMaterialsProvider) instance;
}
else {
throw new IllegalArgumentException("Class " + empClassName + " must implement EncryptionMaterialsProvider");
}
}
catch (Exception x) {
throw new RuntimeException("Unable to initialize EncryptionMaterialsProvider class " + empClassName + ": " + x, x);
}
}
return null;
}
开发者ID:airbnb,项目名称:airpal,代码行数:25,代码来源:AirpalModule.java
示例5: AmazonS3EncryptionClientParamsWrapper
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
AmazonS3EncryptionClientParamsWrapper(AwsSyncClientParams getClientParams,
S3ClientOptions getS3ClientOptions,
EncryptionMaterialsProvider encryptionMaterials,
CryptoConfiguration cryptoConfiguration,
AWSKMS kms) {
this.encryptionMaterials = encryptionMaterials;
this.cryptoConfiguration = cryptoConfiguration;
this.kms = kms;
this.getClientParams = getClientParams;
this.getS3ClientOptions = getS3ClientOptions;
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:12,代码来源:AmazonS3EncryptionClientParamsWrapper.java
示例6: S3CryptoModuleAEStrict
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* @param cryptoConfig a read-only copy of the crypto configuration.
*/
S3CryptoModuleAEStrict(AWSKMS kms, S3Direct s3,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider encryptionMaterialsProvider,
CryptoConfiguration cryptoConfig) {
super(kms, s3, credentialsProvider, encryptionMaterialsProvider,
cryptoConfig);
if (cryptoConfig.getCryptoMode() != StrictAuthenticatedEncryption)
throw new IllegalArgumentException();
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:13,代码来源:S3CryptoModuleAEStrict.java
示例7: S3CryptoModuleBase
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* @param cryptoConfig a read-only copy of the crypto configuration.
*/
protected S3CryptoModuleBase(AWSKMS kms, S3Direct s3,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider kekMaterialsProvider,
CryptoConfiguration cryptoConfig) {
if (!cryptoConfig.isReadOnly())
throw new IllegalArgumentException("The cryto configuration parameter is required to be read-only");
this.kekMaterialsProvider = kekMaterialsProvider;
this.s3 = s3;
this.cryptoConfig = cryptoConfig;
this.cryptoScheme = S3CryptoScheme.from(cryptoConfig.getCryptoMode());
this.contentCryptoScheme = cryptoScheme.getContentCryptoScheme();
this.kms = kms;
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:17,代码来源:S3CryptoModuleBase.java
示例8: newContentCryptoMaterial
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* Returns the content encryption material generated with the given kek
* material, material description and security providers; or null if
* the encryption material cannot be found for the specified description.
*/
private ContentCryptoMaterial newContentCryptoMaterial(
EncryptionMaterialsProvider kekMaterialProvider,
Map<String, String> materialsDescription, Provider provider,
AmazonWebServiceRequest req) {
EncryptionMaterials kekMaterials =
kekMaterialProvider.getEncryptionMaterials(materialsDescription);
if (kekMaterials == null) {
return null;
}
return buildContentCryptoMaterial(kekMaterials, provider, req);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:17,代码来源:S3CryptoModuleBase.java
示例9: S3CryptoModuleEO
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* @param cryptoConfig a read-only copy of the crypto configuration
*/
S3CryptoModuleEO(AWSKMS kms, S3Direct s3,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider encryptionMaterialsProvider,
CryptoConfiguration cryptoConfig) {
super(kms, s3, credentialsProvider, encryptionMaterialsProvider,
cryptoConfig);
if (cryptoConfig.getCryptoMode() != EncryptionOnly)
throw new IllegalArgumentException();
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:13,代码来源:S3CryptoModuleEO.java
示例10: S3CryptoModuleAE
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* @param cryptoConfig a read-only copy of the crypto configuration.
*/
S3CryptoModuleAE(AWSKMS kms, S3Direct s3,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider encryptionMaterialsProvider,
CryptoConfiguration cryptoConfig) {
super(kms, s3, credentialsProvider, encryptionMaterialsProvider,
cryptoConfig);
CryptoMode mode = cryptoConfig.getCryptoMode();
if (mode != StrictAuthenticatedEncryption
&& mode != AuthenticatedEncryption) {
throw new IllegalArgumentException();
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:16,代码来源:S3CryptoModuleAE.java
示例11: getEncryptionMaterials
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
@Override
EncryptionMaterialsProvider getEncryptionMaterials() {
return encryptionMaterials;
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:5,代码来源:AmazonS3EncryptionClientParamsWrapper.java
示例12: CryptoModuleDispatcher
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
public CryptoModuleDispatcher(AWSKMS kms, S3Direct s3,
AWSCredentialsProvider credentialsProvider,
EncryptionMaterialsProvider encryptionMaterialsProvider,
CryptoConfiguration cryptoConfig) {
cryptoConfig = cryptoConfig.clone(); // make a clone
CryptoMode cryptoMode = cryptoConfig.getCryptoMode();
if (cryptoMode == null) {
cryptoMode = EncryptionOnly;
cryptoConfig.setCryptoMode(cryptoMode); // defaults to EO
}
cryptoConfig = cryptoConfig.readOnly(); // make read-only
this.defaultCryptoMode = cryptoConfig.getCryptoMode();
switch(this.defaultCryptoMode) {
case StrictAuthenticatedEncryption:
this.ae = new S3CryptoModuleAEStrict(kms, s3, credentialsProvider,
encryptionMaterialsProvider,
cryptoConfig);
this.eo = null;
break;
case AuthenticatedEncryption:
this.ae = new S3CryptoModuleAE(kms, s3, credentialsProvider,
encryptionMaterialsProvider,
cryptoConfig);
this.eo = null;
break;
case EncryptionOnly:
this.eo = new S3CryptoModuleEO(kms, s3, credentialsProvider,
encryptionMaterialsProvider,
cryptoConfig);
CryptoConfiguration aeConfig = cryptoConfig.clone();
try {
aeConfig.setCryptoMode(AuthenticatedEncryption);
} catch(UnsupportedOperationException ex) {
// BC not available during runtime; but EO can still work.
// Hence ignoring.
}
this.ae = new S3CryptoModuleAE(kms, s3, credentialsProvider,
encryptionMaterialsProvider,
aeConfig.readOnly());
break;
default:
throw new IllegalStateException();
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:45,代码来源:CryptoModuleDispatcher.java
示例13: setEncryptionMaterials
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* Sets the encryption materials to be used to encrypt and decrypt data
* @param encryptionMaterials a provider for the encryption materials
*/
public void setEncryptionMaterials(EncryptionMaterialsProvider encryptionMaterials) {
this.encryptionMaterials = encryptionMaterials;
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:8,代码来源:AmazonS3EncryptionClientBuilder.java
示例14: withEncryptionMaterials
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
/**
* Sets the encryption materials to be used to encrypt and decrypt data
* @param encryptionMaterials A provider for the encryption materials to be used to encrypt and decrypt data.
* @return this object for method chaining
*/
public AmazonS3EncryptionClientBuilder withEncryptionMaterials(EncryptionMaterialsProvider encryptionMaterials) {
setEncryptionMaterials(encryptionMaterials);
return this;
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:10,代码来源:AmazonS3EncryptionClientBuilder.java
示例15: getEncryptionMaterials
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider; //导入依赖的package包/类
abstract EncryptionMaterialsProvider getEncryptionMaterials();
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:2,代码来源:AmazonS3EncryptionClientParams.java
注:本文中的com.amazonaws.services.s3.model.EncryptionMaterialsProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论