public interface WrappableKeyProtectionManager
Depending on implementations, the key encryption key may also only be present on the token. This is the preferred method so as to not expose the secret key information in process memory. The algorithm used to wrap and unwrap keys may also be dependent on implementation.
| Modifier and Type | Method and Description |
|---|---|
Key |
unwrapWithSecretKey(SecretKey kek,
byte[] wrappedData,
String keyAlg,
int keyType)
Unwraps the key with a symmetric secret key encryption key.
|
byte[] |
wrapWithSecretKey(SecretKey kek,
Key keyToWrap)
Wraps a key with a symmetric secret key encryption key.
|
byte[] wrapWithSecretKey(SecretKey kek, Key keyToWrap) throws CryptoException
kek - The key encryption key.keyToWrap - The key to be wrapped.CryptoExceptionKey unwrapWithSecretKey(SecretKey kek, byte[] wrappedData, String keyAlg, int keyType) throws CryptoException
kek - The key encryption key.wrappedData - The wrapped key as a byte array.keyAlg - The algorithm of the key that is being decrypted. Typical parameters are "RSA", "DSA", and "AES" depending on the key type.keyType - The type of key that is wrapped. Valid values should use the Cipher.PRIVATE_KEY and Cipher.SECRET_KEY constants.CryptoExceptionCopyright © 2010–2021 The Direct Project. All rights reserved.