com.ibm.crypto.fips.provider
Class AESSecretKey
- java.lang.Object
com.ibm.crypto.fips.provider.AESSecretKey
All implemented interfaces:
java.io.Serializable, java.security.Key, javax.crypto.SecretKey
- public final class AESSecretKey
- extends java.lang.Object
- implements javax.crypto.SecretKey
Version:
1.00, 11/26/01
Author:
Paschalis Kaltsatis
See Also:
Constructor Summary
| Constructor and Description |
|---|
AESSecretKey(byte[] key)
Create a AES key from a given key
|
AESSecretKey(byte[] key,int offset)
Uses the first 16, 20, or 24 bytes (T) in
key, beginning
at offset, as the AES key.
|
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
finalize()
This function zeroizes the key so that it isn't in memory when GC is done.
|
|
getAlgorithm()
|
|
getEncoded()
|
|
getFormat()
|
|
zeroize()
This function zeroizes the key so that it isn't in memory
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail
AESSecretKey
- public AESSecretKey(byte[] key)
- throws java.security.InvalidKeyException
Create a AES key from a given key
Parameters:
key - the given key Throws:
java.security.InvalidKeyException - if the given key has wrong size AESSecretKey
- public AESSecretKey(byte[] key,
- int offset)
- throws java.security.InvalidKeyException
Uses the first 16, 20, or 24 bytes (T) in
key, beginning
at offset, as the AES key.
Parameters:
key - the buffer with the AES key bytes. offset - the offset in key, where the AES key bytes
start. Throws:
java.security.InvalidKeyException - if invalid number of bytes is left for
the key. Method Detail
getEncoded
- public byte[] getEncoded()
Specified by:
getEncoded in interface java.security.Key
getAlgorithm
- public java.lang.String getAlgorithm( )
Specified by:
getAlgorithm in interface java.security.Key
getFormat
- public java.lang.String getFormat( )
Specified by:
getFormat in interface java.security.Key
zeroize
- public void zeroize()
This function zeroizes the key so that it isn't in memory
finalize
- protected void finalize()
This function zeroizes the key so that it isn't in memory when GC is done.
Overrides:
finalize in class java.lang.Object