com.ibm.crypto.fips.provider

Class AESSecretKey

  1. java.lang.Object
  2. extended bycom.ibm.crypto.fips.provider.AESSecretKey
All implemented interfaces:
java.io.Serializable, java.security.Key, javax.crypto.SecretKey

  1. public final class AESSecretKey
  2. extends java.lang.Object
  3. implements javax.crypto.SecretKey
This class represents a AES key.
Version:
1.00, 11/26/01
Author:
Paschalis Kaltsatis
See Also:
Serialized Form

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
  1. protected
  2. void
finalize()
This function zeroizes the key so that it isn't in memory when GC is done.
  1. java.lang.String
getAlgorithm()
  1. byte[]
getEncoded()
  1. java.lang.String
getFormat()
  1. void
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

  1. public AESSecretKey(byte[] key)
  2. 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

  1. public AESSecretKey(byte[] key,
  2. int offset)
  3. 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

  1. public byte[] getEncoded()
Specified by:
getEncoded in interface java.security.Key

getAlgorithm

  1. public java.lang.String getAlgorithm( )
Specified by:
getAlgorithm in interface java.security.Key

getFormat

  1. public java.lang.String getFormat( )
Specified by:
getFormat in interface java.security.Key

zeroize

  1. public void zeroize()
This function zeroizes the key so that it isn't in memory

finalize

  1. 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