com.ibm.crypto.fips.provider

Class DESedeKey

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

  1. public class DESedeKey
  2. extends java.lang.Object
  3. implements javax.crypto.SecretKey
This class represents a DES-EDE key.
See Also:
Serialized Form

Constructor Summary

Constructor and Description
DESedeKey(byte[] key)
Creates a DES-EDE key from a given key.
DESedeKey(byte[] key,int offset)
Uses the first 24 bytes in key, beginning at offset, as the DES-EDE key

Method Summary

Modifier and Type Method and Description
  1. boolean
equals(java.lang.Object obj)
  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. int
hashCode()
Calculates a hash code value for the object.
  1. void
zeroize()
This function zeroizes the key so that it isn't in memory
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DESedeKey

  1. public DESedeKey(byte[] key)
  2. throws java.security.InvalidKeyException
Creates a DES-EDE key from a given key.
Parameters:
key - the given key
Throws:
java.security.InvalidKeyException - if the given key has a wrong size

DESedeKey

  1. public DESedeKey(byte[] key,
  2. int offset)
  3. throws java.security.InvalidKeyException
Uses the first 24 bytes in key, beginning at offset, as the DES-EDE key
Parameters:
key - the buffer with the DES-EDE key
offset - the offset in key, where the DES-EDE key starts
Throws:
java.security.InvalidKeyException - if the given key has a wrong size

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

hashCode

  1. public int hashCode()
Calculates a hash code value for the object. Objects that are equal will also have the same hashcode.
Overrides:
hashCode in class java.lang.Object

equals

  1. public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

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