public class NativeAESWrapCipherSpi extends AbstractAESWrapCipherSpi
| Constructor and Description |
|---|
NativeAESWrapCipherSpi(int nativeTransformationId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
engineInit(boolean decrypting,
SecretKey key)
Initializes the AES Key Wrap cipher with the given key.
|
static NativeAESWrapCipherSpi |
getInstance(String transformation)
Creates a cipher context for the given transformation.
|
static int |
nativeGetTransformation(byte[] transformation)
Gets for the given transformation the cipher id.
|
protected SecretKey |
unwrap(byte[] wrappedKey,
String wrappedKeyAlgorithm,
int wrappedKeyType)
Unwrap a previously wrapped key.
|
protected byte[] |
wrap(SecretKey key)
Wrap a key.
|
addExact, engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetOutputSize, engineInit, engineInit, engineUnwrap, engineUpdate, engineUpdate, engineWrapengineUpdateAADprotected void engineInit(boolean decrypting,
SecretKey key)
throws InvalidKeyException
AbstractAESWrapCipherSpiengineInit in class AbstractAESWrapCipherSpidecrypting - flag indicating wrap or unwrap modekey - the key (never null)InvalidKeyException - if the given key is inappropriate for initializing this cipher@Nullable public static NativeAESWrapCipherSpi getInstance(String transformation)
transformation - the cipher transformation to be usednull if the transformation is not supported.public static int nativeGetTransformation(byte[] transformation)
transformation - Null terminated string that describes the transformationprotected SecretKey unwrap(byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException
AbstractAESWrapCipherSpiunwrap in class AbstractAESWrapCipherSpiwrappedKey - the key to be unwrapped.wrappedKeyAlgorithm - the algorithm the wrapped key is for.wrappedKeyType - the type of the wrapped key. This is one of Cipher.SECRET_KEY,
Cipher.PRIVATE_KEY, or Cipher.PUBLIC_KEY.InvalidKeyException - if wrappedKey does not represent a wrapped key of type wrappedKeyType
for the wrappedKeyAlgorithm.protected byte[] wrap(SecretKey key) throws InvalidKeyException, IllegalBlockSizeException
AbstractAESWrapCipherSpiwrap in class AbstractAESWrapCipherSpikey - the key to be wrapped.InvalidKeyException - if it is impossible to wrap the key with this cipher.IllegalBlockSizeException - the length of the encoding of the key to be wrapped is not a multiple of the block size.