public final class KeyWrapAlgorithmImpl3DES extends java.lang.Object implements KeyWrapAlgorithm
KeyWrapAlgorithm interface, so the Toolkit's
Triple DES key wrap implementation is made available for XML encryption.| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] bytesToBeUnwrapped)
Decrypts a byte array.
|
byte[] |
encrypt(byte[] bytesToBeWrapped)
Encrypts a byte array.
|
byte[] |
getEncoded()
Retrieves the
KeyEncryptionKey associated with this
KeyWrapAlgorithm. |
java.lang.String |
getIVparameters()
Retrieves a Base 64 encoding of the initialization vector that was
used at the most recent invocation of
initWrap() or
initUnwrap(). |
URI |
getURI()
Gets the algorithm identifier, which is a
URI. |
void |
initDecrypt(byte[] keyBytes,
byte[] iv)
Initializes the symmetric cipher for unwrapping.
|
void |
initEncrypt()
Initializes the symmetric cipher for wrapping a key data using
TripleDES.
|
void |
setPrivateKey(java.security.PrivateKey decryptionKey)
Required to implement the
EncryptionAlgorithm interface,
but does nothing, since TripleDES is a symmetric cipher. |
void |
setPublicKey(java.security.PublicKey encryptionKey)
Required to implement the
EncryptionAlgorithm interface,
but does nothing, since TripleDES is a symmetric cipher. |
void |
setSecretKey(javax.crypto.SecretKey secretKey)
Sets a secret key to wrap or unwrap an <EncryptedKey> element.
|
void |
setURI(URI uri)
Sets the algorithm identifier, which is a
URI. |
public URI getURI()
URI.getURI in interface EncryptionAlgorithmXMLEConstants.ALGORITHM_3DES_KEY_WRAPpublic void setURI(URI uri)
URI.setURI in interface EncryptionAlgorithmuri - a URI reference that identifies the algorithmXMLEConstants.ALGORITHM_3DES_KEY_WRAPpublic byte[] getEncoded()
KeyEncryptionKey associated with this
KeyWrapAlgorithm.getEncoded in interface EncryptionAlgorithmKeyEncryptionKey associated with this
KeyWrapAlgorithm.public void setSecretKey(javax.crypto.SecretKey secretKey)
throws EncryptionAlgorithmException
setSecretKey in interface KeyWrapAlgorithmsecretKey - the secret key to be used for wrapping or unwrappingEncryptionAlgorithmExceptionpublic void initEncrypt()
throws EncryptionAlgorithmException
Uses the application provided key encryption key.
initEncrypt in interface EncryptionAlgorithmEncryptionAlgorithmExceptionpublic void initDecrypt(byte[] keyBytes,
byte[] iv)
throws EncryptionAlgorithmException
Uses the application-provided key encryption key.
The parameters keyBytes and iv are
ignored.
initDecrypt in interface EncryptionAlgorithmkeyBytes - the key material for a secret keyiv - initialization vector to be used in the decryption operationEncryptionAlgorithmExceptionpublic byte[] encrypt(byte[] bytesToBeWrapped)
throws EncryptionAlgorithmException
encrypt in interface EncryptionAlgorithmbytesToBeWrapped - a byte[] containing key data to be wrappedbyte[] that contains the wrapped key data.EncryptionAlgorithmExceptionpublic byte[] decrypt(byte[] bytesToBeUnwrapped)
throws EncryptionAlgorithmException
decrypt in interface EncryptionAlgorithmbytesToBeUnwrapped - a byte[] containing data to be decryptedbyte[] that contains the decrypted key data.EncryptionAlgorithmExceptionpublic java.lang.String getIVparameters()
throws EncryptionAlgorithmException
initWrap() or
initUnwrap().getIVparameters in interface EncryptionAlgorithmString containing the initialization vector.EncryptionAlgorithmExceptionpublic void setPrivateKey(java.security.PrivateKey decryptionKey)
throws EncryptionAlgorithmException
EncryptionAlgorithm interface,
but does nothing, since TripleDES is a symmetric cipher.setPrivateKey in interface EncryptionAlgorithmdecryptionKey - the private decryption keyEncryptionAlgorithmExceptionPrivateKeypublic void setPublicKey(java.security.PublicKey encryptionKey)
throws EncryptionAlgorithmException
EncryptionAlgorithm interface,
but does nothing, since TripleDES is a symmetric cipher.setPublicKey in interface EncryptionAlgorithmEncryptionAlgorithmExceptionPublicKey