KMSClientProvider.KMSEncryptedKeyVersionpublic static class KeyProviderCryptoExtension.EncryptedKeyVersion
extends java.lang.Object
| Modifier | Constructor | Description |
|---|---|---|
protected |
EncryptedKeyVersion(java.lang.String keyName,
java.lang.String encryptionKeyVersionName,
byte[] encryptedKeyIv,
KeyProvider.KeyVersion encryptedKeyVersion) |
Create a new EncryptedKeyVersion.
|
| Modifier and Type | Method | Description |
|---|---|---|
static KeyProviderCryptoExtension.EncryptedKeyVersion |
createForDecryption(java.lang.String keyName,
java.lang.String encryptionKeyVersionName,
byte[] encryptedKeyIv,
byte[] encryptedKeyMaterial) |
Factory method to create a new EncryptedKeyVersion that can then be
passed into
KeyProviderCryptoExtension.decryptEncryptedKey(org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.EncryptedKeyVersion). |
protected static byte[] |
deriveIV(byte[] encryptedKeyIV) |
Derive the initialization vector (IV) for the encryption key from the IV
of the encrypted key.
|
byte[] |
getEncryptedKeyIv() |
|
KeyProvider.KeyVersion |
getEncryptedKeyVersion() |
|
java.lang.String |
getEncryptionKeyName() |
|
java.lang.String |
getEncryptionKeyVersionName() |
protected EncryptedKeyVersion(java.lang.String keyName,
java.lang.String encryptionKeyVersionName,
byte[] encryptedKeyIv,
KeyProvider.KeyVersion encryptedKeyVersion)
keyName - Name of the encryption key used to
encrypt the encrypted key.encryptionKeyVersionName - Version name of the encryption key used
to encrypt the encrypted key.encryptedKeyIv - Initialization vector of the encrypted
key. The IV of the encryption key used to
encrypt the encrypted key is derived from
this IV.encryptedKeyVersion - The encrypted encryption key version.public static KeyProviderCryptoExtension.EncryptedKeyVersion createForDecryption(java.lang.String keyName, java.lang.String encryptionKeyVersionName, byte[] encryptedKeyIv, byte[] encryptedKeyMaterial)
KeyProviderCryptoExtension.decryptEncryptedKey(org.apache.hadoop.crypto.key.KeyProviderCryptoExtension.EncryptedKeyVersion). Note that the fields of the
returned EncryptedKeyVersion will only partially be populated; it is not
necessarily suitable for operations besides decryption.keyName - Key name of the encryption key use to encrypt the
encrypted key.encryptionKeyVersionName - Version name of the encryption key used
to encrypt the encrypted key.encryptedKeyIv - Initialization vector of the encrypted
key. The IV of the encryption key used to
encrypt the encrypted key is derived from
this IV.encryptedKeyMaterial - Key material of the encrypted key.public java.lang.String getEncryptionKeyName()
public java.lang.String getEncryptionKeyVersionName()
public byte[] getEncryptedKeyIv()
public KeyProvider.KeyVersion getEncryptedKeyVersion()
protected static byte[] deriveIV(byte[] encryptedKeyIV)
The alternative to this is using the same IV for both the encryption key and the encrypted key. Even a simple symmetric transformation like this improves security by avoiding IV re-use. IVs will also be fairly unique among different EEKs.
encryptedKeyIV - of the encrypted key (i.e. getEncryptedKeyIv())Copyright © 2008–2025 Apache Software Foundation. All rights reserved.