com.ibm.crypto.fips.provider
Class DESedeKey
- java.lang.Object
-
- com.ibm.crypto.fips.provider.DESedeKey
-
- All Implemented Interfaces:
- java.io.Serializable, java.security.Key, javax.crypto.SecretKey, javax.security.auth.Destroyable
public final class DESedeKey extends java.lang.Object implements javax.crypto.SecretKeyThis class represents a DES-EDE key.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors 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 inkey, beginning atoffset, as the DES-EDE key
-
Method Summary
Methods Modifier and Type Method and Description booleanequals(java.lang.Object obj)protected voidfinalize()This function zeroizes the key so that it isn't in memory when GC is done.java.lang.StringgetAlgorithm()byte[]getEncoded()java.lang.StringgetFormat()inthashCode()Calculates a hash code value for the object.voidzeroize()This function zeroizes the key so that it isn't in memory
-
-
-
Constructor Detail
-
DESedeKey
public DESedeKey(byte[] key) throws java.security.InvalidKeyExceptionCreates 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
public DESedeKey(byte[] key, int offset) throws java.security.InvalidKeyExceptionUses the first 24 bytes inkey, beginning atoffset, as the DES-EDE key- Parameters:
key- the buffer with the DES-EDE keyoffset- the offset inkey, where the DES-EDE key starts- Throws:
java.security.InvalidKeyException- if the given key has a wrong size
-
-
Method Detail
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfacejava.security.Key
-
getAlgorithm
public java.lang.String getAlgorithm()
- Specified by:
getAlgorithmin interfacejava.security.Key
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key
-
hashCode
public int hashCode()
Calculates a hash code value for the object. Objects that are equal will also have the same hashcode.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
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:
finalizein classjava.lang.Object
-
-