public static class AwsKmsMrkAwareMasterKeyProvider.Builder extends Object implements Cloneable
Modifier and Type | Method and Description |
---|---|
AwsKmsMrkAwareMasterKeyProvider |
buildDiscovery()
Builds the master key provider in Discovery Mode.
|
AwsKmsMrkAwareMasterKeyProvider |
buildDiscovery(DiscoveryFilter filter)
Builds the master key provider in Discovery Mode with a
DiscoveryFilter . |
AwsKmsMrkAwareMasterKeyProvider |
buildStrict(List<String> keyIds)
Builds the master key provider in Strict Mode.
|
AwsKmsMrkAwareMasterKeyProvider |
buildStrict(String... keyIds)
Builds the master key provider in strict mode.
|
AwsKmsMrkAwareMasterKeyProvider.Builder |
clone() |
AwsKmsMrkAwareMasterKeyProvider.Builder |
withClientBuilder(com.amazonaws.services.kms.AWSKMSClientBuilder builder)
Configures the
AwsKmsMrkAwareMasterKeyProvider to use settings from this AWSKMSClientBuilder to configure KMS clients. |
AwsKmsMrkAwareMasterKeyProvider.Builder |
withCredentials(com.amazonaws.auth.AWSCredentials credentials)
Configures the
AwsKmsMrkAwareMasterKeyProvider to use specific credentials. |
AwsKmsMrkAwareMasterKeyProvider.Builder |
withCredentials(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider)
Configures the
AwsKmsMrkAwareMasterKeyProvider to use specific credentials. |
AwsKmsMrkAwareMasterKeyProvider.Builder |
withCustomClientFactory(KmsMasterKeyProvider.RegionalClientSupplier regionalClientSupplier)
Provides a custom factory function that will vend KMS clients.
|
AwsKmsMrkAwareMasterKeyProvider.Builder |
withDefaultRegion(String defaultRegion)
Sets the default region.
|
AwsKmsMrkAwareMasterKeyProvider.Builder |
withDiscoveryMrkRegion(String discoveryMrkRegion)
Sets the region contacted for multi-region keys when in Discovery mode.
|
public AwsKmsMrkAwareMasterKeyProvider.Builder clone()
public AwsKmsMrkAwareMasterKeyProvider.Builder withDefaultRegion(String defaultRegion)
MasterKeyProvider.getMasterKey(String)
that are not full ARNs, but
are instead bare key IDs or aliases.
If the default region is not specified, the AWS SDK default region will be used.
defaultRegion
- The default region to use.KmsMasterKeyProvider.Builder.withDefaultRegion(String)
public AwsKmsMrkAwareMasterKeyProvider.Builder withDiscoveryMrkRegion(String discoveryMrkRegion)
MasterKeyProvider.getMasterKey(String)
.
discoveryMrkRegion
- The region to contact to attempt to decrypt multi-region keys.public AwsKmsMrkAwareMasterKeyProvider.Builder withCustomClientFactory(KmsMasterKeyProvider.RegionalClientSupplier regionalClientSupplier)
Because the regional client supplier fully controls the client construction process, it is
not possible to configure the client through methods such as withCredentials(AWSCredentialsProvider)
or withClientBuilder(AWSKMSClientBuilder)
;
if you try to use these in combination, an IllegalStateException
will be thrown.
public AwsKmsMrkAwareMasterKeyProvider.Builder withCredentials(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider)
AwsKmsMrkAwareMasterKeyProvider
to use specific credentials. If a
builder was previously set, this will override whatever credentials it set.public AwsKmsMrkAwareMasterKeyProvider.Builder withCredentials(com.amazonaws.auth.AWSCredentials credentials)
AwsKmsMrkAwareMasterKeyProvider
to use specific credentials. If a
builder was previously set, this will override whatever credentials it set.public AwsKmsMrkAwareMasterKeyProvider.Builder withClientBuilder(com.amazonaws.services.kms.AWSKMSClientBuilder builder)
AwsKmsMrkAwareMasterKeyProvider
to use settings from this AWSKMSClientBuilder
to configure KMS clients. Note that the region set on this builder will
be ignored, but all other settings will be propagated into the regional clients.
This method will overwrite any credentials set using withCredentials(AWSCredentialsProvider)
.
public AwsKmsMrkAwareMasterKeyProvider buildDiscovery()
public AwsKmsMrkAwareMasterKeyProvider buildDiscovery(DiscoveryFilter filter)
DiscoveryFilter
. In Discovery
Mode the KMS Master Key Provider will attempt to decrypt using any key identifier it
discovers in the encrypted message that is accepted by the filter
. KMS Master Key
Providers in Discovery Mode will not encrypt data keys.public AwsKmsMrkAwareMasterKeyProvider buildStrict(List<String> keyIds)
keyIds
. KMS Master Key Providers in
Strict Mode will encrypt data keys using the keys listed in keyIds
In Strict Mode, one or more CMKs must be provided. For Master Key Providers that will only be used for encryption, you can use any valid KMS key identifier. For providers that will be used for decryption, you must use the key ARN; key ids, alias names, and alias ARNs are not supported.
public AwsKmsMrkAwareMasterKeyProvider buildStrict(String... keyIds)
keyIds
. KMS Master Key Providers in
Strict Mode will encrypt data keys using the keys listed in keyIds
In Strict Mode, one or more CMKs must be provided. For Master Key Providers that will only be used for encryption, you can use any valid KMS key identifier. For providers that will be used for decryption, you must use the key ARN; key ids, alias names, and alias ARNs are not supported.
Copyright © 2023. All rights reserved.