/** * Decrypts an encrypted byte[] key material using the given a key version * name and initialization vector. * * @param encryptedKey contains keyVersionName and IV to decrypt the encrypted * key material * @return a KeyVersion with the decrypted key material, the version name is * 'EK' (For Encryption Key) * @throws IOException thrown if the key material could not be decrypted * @throws GeneralSecurityException thrown if the key material could not be * decrypted because of a cryptographic issue. */ public KeyVersion decryptEncryptedKey(EncryptedKeyVersion encryptedKey) throws IOException, GeneralSecurityException { return getExtension().decryptEncryptedKey(encryptedKey); }
/** * Generates a key material and encrypts it using the given key version name * and initialization vector. The generated key material is of the same * length as the <code>KeyVersion</code> material and is encrypted using the * same cipher. * <p/> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param encryptionKeyName The latest KeyVersion of this key's material will * be encrypted. * @return EncryptedKeyVersion with the generated key material, the version * name is 'EEK' (for Encrypted Encryption Key) * @throws IOException thrown if the key material could not be generated * @throws GeneralSecurityException thrown if the key material could not be * encrypted because of a cryptographic issue. */ public EncryptedKeyVersion generateEncryptedKey(String encryptionKeyName) throws IOException, GeneralSecurityException { return getExtension().generateEncryptedKey(encryptionKeyName); }
/** * Notifies the Underlying CryptoExtension implementation to warm up any * implementation specific caches for the specified KeyVersions * @param keyNames Arrays of key Names */ public void warmUpEncryptedKeys(String... keyNames) throws IOException { getExtension().warmUpEncryptedKeys(keyNames); }
/** * Generates a key material and encrypts it using the given key version name * and initialization vector. The generated key material is of the same * length as the <code>KeyVersion</code> material and is encrypted using the * same cipher. * <p/> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param encryptionKeyName The latest KeyVersion of this key's material will * be encrypted. * @return EncryptedKeyVersion with the generated key material, the version * name is 'EEK' (for Encrypted Encryption Key) * @throws IOException thrown if the key material could not be generated * @throws GeneralSecurityException thrown if the key material could not be * encrypted because of a cryptographic issue. */ public EncryptedKeyVersion generateEncryptedKey(String encryptionKeyName) throws IOException, GeneralSecurityException { return getExtension().generateEncryptedKey(encryptionKeyName); }
/** * Generates a key material and encrypts it using the given key version name * and initialization vector. The generated key material is of the same * length as the <code>KeyVersion</code> material and is encrypted using the * same cipher. * <p/> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param encryptionKeyName The latest KeyVersion of this key's material will * be encrypted. * @return EncryptedKeyVersion with the generated key material, the version * name is 'EEK' (for Encrypted Encryption Key) * @throws IOException thrown if the key material could not be generated * @throws GeneralSecurityException thrown if the key material could not be * encrypted because of a cryptographic issue. */ public EncryptedKeyVersion generateEncryptedKey(String encryptionKeyName) throws IOException, GeneralSecurityException { return getExtension().generateEncryptedKey(encryptionKeyName); }
/** * Generates a key material and encrypts it using the given key version name * and initialization vector. The generated key material is of the same * length as the <code>KeyVersion</code> material and is encrypted using the * same cipher. * <p/> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param encryptionKeyName The latest KeyVersion of this key's material will * be encrypted. * @return EncryptedKeyVersion with the generated key material, the version * name is 'EEK' (for Encrypted Encryption Key) * @throws IOException thrown if the key material could not be generated * @throws GeneralSecurityException thrown if the key material could not be * encrypted because of a cryptographic issue. */ public EncryptedKeyVersion generateEncryptedKey(String encryptionKeyName) throws IOException, GeneralSecurityException { return getExtension().generateEncryptedKey(encryptionKeyName); }
/** * Roll a new version of the given key generating the material for it. * <p> * Due to the caching on the ValueQueue, even after a rollNewVersion call, * {@link #generateEncryptedKey(String)} may still return an old key - even * when we drain the queue here, the async thread may later fill in old keys. * This is acceptable since old version keys are still able to decrypt, and * client shall make no assumptions that it will get a new versioned key * after rollNewVersion. */ @Override public KeyVersion rollNewVersion(String name) throws NoSuchAlgorithmException, IOException { KeyVersion keyVersion = super.rollNewVersion(name); getExtension().drain(name); return keyVersion; }
/** * Decrypts an encrypted byte[] key material using the given a key version * name and initialization vector. * * @param encryptedKey contains keyVersionName and IV to decrypt the encrypted * key material * @return a KeyVersion with the decrypted key material, the version name is * 'EK' (For Encryption Key) * @throws IOException thrown if the key material could not be decrypted * @throws GeneralSecurityException thrown if the key material could not be * decrypted because of a cryptographic issue. */ public KeyVersion decryptEncryptedKey(EncryptedKeyVersion encryptedKey) throws IOException, GeneralSecurityException { return getExtension().decryptEncryptedKey(encryptedKey); }
/** * Decrypts an encrypted byte[] key material using the given a key version * name and initialization vector. * * @param encryptedKey contains keyVersionName and IV to decrypt the encrypted * key material * @return a KeyVersion with the decrypted key material, the version name is * 'EK' (For Encryption Key) * @throws IOException thrown if the key material could not be decrypted * @throws GeneralSecurityException thrown if the key material could not be * decrypted because of a cryptographic issue. */ public KeyVersion decryptEncryptedKey(EncryptedKeyVersion encryptedKey) throws IOException, GeneralSecurityException { return getExtension().decryptEncryptedKey(encryptedKey); }
/** * Decrypts an encrypted byte[] key material using the given a key version * name and initialization vector. * * @param encryptedKey contains keyVersionName and IV to decrypt the encrypted * key material * @return a KeyVersion with the decrypted key material, the version name is * 'EK' (For Encryption Key) * @throws IOException thrown if the key material could not be decrypted * @throws GeneralSecurityException thrown if the key material could not be * decrypted because of a cryptographic issue. */ public KeyVersion decryptEncryptedKey(EncryptedKeyVersion encryptedKey) throws IOException, GeneralSecurityException { return getExtension().decryptEncryptedKey(encryptedKey); }
@Override public void invalidateCache(String name) throws IOException { super.invalidateCache(name); getExtension().drain(name); } }
@Override public KeyVersion rollNewVersion(String name, byte[] material) throws IOException { KeyVersion keyVersion = super.rollNewVersion(name, material); getExtension().drain(name); return keyVersion; }
/** * Notifies the Underlying CryptoExtension implementation to warm up any * implementation specific caches for the specified KeyVersions * @param keyNames Arrays of key Names */ public void warmUpEncryptedKeys(String... keyNames) throws IOException { getExtension().warmUpEncryptedKeys(keyNames); }
/** * Notifies the Underlying CryptoExtension implementation to warm up any * implementation specific caches for the specified KeyVersions * @param keyNames Arrays of key Names */ public void warmUpEncryptedKeys(String... keyNames) throws IOException { getExtension().warmUpEncryptedKeys(keyNames); }
/** * Notifies the Underlying CryptoExtension implementation to warm up any * implementation specific caches for the specified KeyVersions * @param keyNames Arrays of key Names */ public void warmUpEncryptedKeys(String... keyNames) throws IOException { getExtension().warmUpEncryptedKeys(keyNames); }
/** * Re-encrypts an encrypted key version, using its initialization vector * and key material, but with the latest key version name of its key name * in the key provider. * <p> * If the latest key version name in the provider is the * same as the one encrypted the passed-in encrypted key version, the same * encrypted key version is returned. * <p> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param ekv The EncryptedKeyVersion containing keyVersionName and IV. * @return The re-encrypted EncryptedKeyVersion. * @throws IOException If the key material could not be re-encrypted * @throws GeneralSecurityException If the key material could not be * re-encrypted because of a cryptographic issue. */ public EncryptedKeyVersion reencryptEncryptedKey(EncryptedKeyVersion ekv) throws IOException, GeneralSecurityException { return getExtension().reencryptEncryptedKey(ekv); }
/** * Generates a key material and encrypts it using the given key version name * and initialization vector. The generated key material is of the same * length as the <code>KeyVersion</code> material and is encrypted using the * same cipher. * <p/> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param encryptionKeyName The latest KeyVersion of this key's material will * be encrypted. * @return EncryptedKeyVersion with the generated key material, the version * name is 'EEK' (for Encrypted Encryption Key) * @throws IOException thrown if the key material could not be generated * @throws GeneralSecurityException thrown if the key material could not be * encrypted because of a cryptographic issue. */ public EncryptedKeyVersion generateEncryptedKey(String encryptionKeyName) throws IOException, GeneralSecurityException { return getExtension().generateEncryptedKey(encryptionKeyName); }
/** * Batched version of {@link #reencryptEncryptedKey(EncryptedKeyVersion)}. * <p> * For each encrypted key version, re-encrypts an encrypted key version, * using its initialization vector and key material, but with the latest * key version name of its key name. If the latest key version name in the * provider is the same as the one encrypted the passed-in encrypted key * version, the same encrypted key version is returned. * <p> * NOTE: The generated key is not stored by the <code>KeyProvider</code> * * @param ekvs List containing the EncryptedKeyVersion's * @return The re-encrypted EncryptedKeyVersion's, in the same order. * @throws IOException If any EncryptedKeyVersion could not be re-encrypted * @throws GeneralSecurityException If any EncryptedKeyVersion could not be * re-encrypted because of a cryptographic issue. */ public void reencryptEncryptedKeys(List<EncryptedKeyVersion> ekvs) throws IOException, GeneralSecurityException { getExtension().reencryptEncryptedKeys(ekvs); }
/** * Decrypts an encrypted byte[] key material using the given a key version * name and initialization vector. * * @param encryptedKey contains keyVersionName and IV to decrypt the encrypted * key material * @return a KeyVersion with the decrypted key material, the version name is * 'EK' (For Encryption Key) * @throws IOException thrown if the key material could not be decrypted * @throws GeneralSecurityException thrown if the key material could not be * decrypted because of a cryptographic issue. */ public KeyVersion decryptEncryptedKey(EncryptedKeyVersion encryptedKey) throws IOException, GeneralSecurityException { return getExtension().decryptEncryptedKey(encryptedKey); }
/** * Notifies the Underlying CryptoExtension implementation to warm up any * implementation specific caches for the specified KeyVersions * @param keyNames Arrays of key Names */ public void warmUpEncryptedKeys(String... keyNames) throws IOException { getExtension().warmUpEncryptedKeys(keyNames); }