Class AzureKmsDriver
java.lang.Object
io.confluent.kafka.schemaregistry.encryption.azure.AzureKmsDriver
- All Implemented Interfaces:
KmsDriver
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringEnables making a DEK's encryptedKeyMaterial self-describing with respect to which exact Azure Key Vault key version wrapped it (seeAzureKmsAead), matching the same self-description property AWS KMS and GCP KMS ciphertext already provide natively.static final Stringstatic final StringFields inherited from interface io.confluent.kafka.schemaregistry.encryption.tink.KmsDriver
KMS_TYPE_SUFFIX, TEST_CLIENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetVersionedKeyId(Map<String, ?> configs, String kmsKeyId) Resolves a possibly-versionless Azure Key Vault key identifier (e.g.booleanstatic booleanisVersionless(String kmsKeyId) Returns true ifkmsKeyIdhas no explicit version segment.com.google.crypto.tink.KmsClientnewKmsClient(Map<String, ?> configs, Optional<String> kekUrl) protected static com.google.crypto.tink.KmsClientnewKmsClientWithAzureKms(Map<String, ?> configs, Optional<String> keyUri, Optional<com.azure.core.credential.TokenCredential> credentials, com.azure.security.keyvault.keys.cryptography.CryptographyClient cryptographyClient) static StringwithVersion(String kmsKeyId, String version) CombineskmsKeyId(versionless or versioned; only the vault and key name are used) with an explicitversion, returning the full versioned key identifier.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.confluent.kafka.schemaregistry.encryption.tink.KmsDriver
doesSupport, getKmsClient, getTestClient, isAccessDenied, isAccessDeniedStatus, registerKmsClient
-
Field Details
-
TENANT_ID
- See Also:
-
CLIENT_ID
- See Also:
-
CLIENT_SECRET
- See Also:
-
ENCRYPT_AZURE_KEY_VERSION_SAVE
Enables making a DEK's encryptedKeyMaterial self-describing with respect to which exact Azure Key Vault key version wrapped it (seeAzureKmsAead), matching the same self-description property AWS KMS and GCP KMS ciphertext already provide natively. Set as a kek kmsProps entry.- See Also:
-
TEST_KEY_CLIENT
- See Also:
-
-
Constructor Details
-
AzureKmsDriver
public AzureKmsDriver()
-
-
Method Details
-
getKeyUrlPrefix
- Specified by:
getKeyUrlPrefixin interfaceKmsDriver
-
isAccessDeniedException
- Specified by:
isAccessDeniedExceptionin interfaceKmsDriver
-
getVersionedKeyId
public static String getVersionedKeyId(Map<String, ?> configs, String kmsKeyId) throws GeneralSecurityExceptionResolves a possibly-versionless Azure Key Vault key identifier (e.g.https://vault.vault.azure.net/keys/name) into the concrete, currently-enabled version (e.g.https://vault.vault.azure.net/keys/name/<version>). IfkmsKeyIdalready includes a version segment, it is returned unchanged and no call is made. This exists because, unlike AWS KMS and GCP KMS, Azure Key Vault's wrap/unwrap operations address an explicit key version and do not embed that version in the returned ciphertext, so a caller that only ever uses a versionless reference has no way to know which version encrypted a given DEK once the key has been rotated.- Throws:
GeneralSecurityException
-
withVersion
CombineskmsKeyId(versionless or versioned; only the vault and key name are used) with an explicitversion, returning the full versioned key identifier. Used to reconstruct a target for a version extracted from an already-wrapped DEK, which may differ from whatevergetVersionedKeyId(java.util.Map<java.lang.String, ?>, java.lang.String)currently resolves to (e.g. after a rotation).- Throws:
GeneralSecurityException
-
isVersionless
Returns true ifkmsKeyIdhas no explicit version segment. Used to warn when ENCRYPT_AZURE_KEY_VERSION_SAVE is not enabled for a versionless key, without performing any actual resolution (noKeyClientcall).- Throws:
GeneralSecurityException
-
newKmsClient
public com.google.crypto.tink.KmsClient newKmsClient(Map<String, ?> configs, Optional<String> kekUrl) throws GeneralSecurityException- Specified by:
newKmsClientin interfaceKmsDriver- Throws:
GeneralSecurityException
-
newKmsClientWithAzureKms
protected static com.google.crypto.tink.KmsClient newKmsClientWithAzureKms(Map<String, ?> configs, Optional<String> keyUri, Optional<com.azure.core.credential.TokenCredential> credentials, com.azure.security.keyvault.keys.cryptography.CryptographyClient cryptographyClient) throws GeneralSecurityException- Throws:
GeneralSecurityException
-