| Modifier and Type | Field and Description |
|---|---|
static String |
PREFIX
The prefix of all keys stored in AWS KMS.
|
| Constructor and Description |
|---|
AwsKmsClient()
Constructs a generic AwsKmsClient that is not bound to any specific key.
|
AwsKmsClient(String uri)
Constructs a specific AwsKmsClient that is bound to a single key identified by
uri. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
doesSupport(String uri) |
com.google.crypto.tink.Aead |
getAead(String uri) |
static void |
register(Optional<String> keyUri,
Optional<String> credentialPath)
Creates and registers a
AwsKmsClient(java.lang.String) with the Tink runtime. |
protected static String |
removePrefix(String expectedPrefix,
String kmsKeyUri) |
com.google.crypto.tink.KmsClient |
withCredentials(String credentialPath)
Loads AWS credentials from a properties file.
|
com.google.crypto.tink.KmsClient |
withCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider provider)
Loads AWS credentials from a provider.
|
com.google.crypto.tink.KmsClient |
withDefaultCredentials()
Loads default AWS credentials.
|
public static final String PREFIX
public AwsKmsClient()
public AwsKmsClient(String uri)
uri.
This constructor should not be used. We recommend to register the client instead.public boolean doesSupport(String uri)
doesSupport in interface com.google.crypto.tink.KmsClientPREFIX, or the client is a specific one that is bound to the key identified
by uri.@CanIgnoreReturnValue public com.google.crypto.tink.KmsClient withCredentials(String credentialPath) throws GeneralSecurityException
The AWS access key ID is expected to be in the accessKey property and the AWS
secret key is expected to be in the secretKey property.
withCredentials in interface com.google.crypto.tink.KmsClientGeneralSecurityException - if the client initialization fails@CanIgnoreReturnValue
public com.google.crypto.tink.KmsClient withDefaultCredentials()
throws GeneralSecurityException
AWS credentials provider chain that looks for credentials in this order:
withDefaultCredentials in interface com.google.crypto.tink.KmsClientGeneralSecurityException - if the client initialization fails@CanIgnoreReturnValue
public com.google.crypto.tink.KmsClient withCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider provider)
throws GeneralSecurityException
GeneralSecurityExceptionpublic com.google.crypto.tink.Aead getAead(String uri) throws GeneralSecurityException
getAead in interface com.google.crypto.tink.KmsClientGeneralSecurityExceptionpublic static void register(Optional<String> keyUri, Optional<String> credentialPath) throws GeneralSecurityException
AwsKmsClient(java.lang.String) with the Tink runtime.
If keyUri is present, it is the only key that the new client will support. Otherwise
the new client supports all AWS KMS keys.
If credentialPath is present, load the credentials from that. Otherwise use the
default credentials.
GeneralSecurityExceptionCopyright © 2025 Confluent, Inc.. All rights reserved.