java.lang.Object
com.ibm.crypto.hdwrCCA.provider.HMACKey
- All Implemented Interfaces:
Serializable
,Key
,SecretKey
,Destroyable
This class represents an HMAC secret key.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleaner()
Call the class IBMJCECCACleaner to clean up the bytes of this key, ICSF token, or CKDS label.void
Delete the CKDS entry associated with this key object.boolean
Performs a deep compare to determine whether the given object represents a key identical to the key represented by this object.Returns the HMAC algorithm name associated with this key object.byte[]
Returns the CKDS label for a"CKDSLabel"
type key.Returns the key type or key format of this key object, this will always be"CKDSLabel"
.Returns a copy of the CKDS label associated with this key object if this is a"CKDSLabel"
key object.int
hashCode()
Calculates a hash code value for this key object.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Method Details
-
getEncoded
public byte[] getEncoded()Returns the CKDS label for a"CKDSLabel"
type key.Note that this method returns a clone of sensitive information. It is the caller's responsibility to zero out the information after it is no longer needed.
- Specified by:
getEncoded
in interfaceKey
- Returns:
- a clone of the encoded key value which will be the CKDS label of the key. The CKDS label returned will be in the IBM-1047 codepage. If an error is encountered, null is returned.
-
getLabelString
Returns a copy of the CKDS label associated with this key object if this is a"CKDSLabel"
key object.- Returns:
- a copy of the CKDS label if this is a
"CKDSLabel"
key object. This value will be exactly what is used within the CCA key repository as a label, including trailing blanks. - Throws:
InvalidKeyException
- if this is not a"CKDSLabel"
key object.
-
getAlgorithm
Returns the HMAC algorithm name associated with this key object.- Specified by:
getAlgorithm
in interfaceKey
- Returns:
- the HMAC algorithm name.
-
getFormat
Returns the key type or key format of this key object, this will always be"CKDSLabel"
. -
deleteCKDSEntry
Delete the CKDS entry associated with this key object.- Throws:
InvalidKeyException
- if this is not a"CKDSLabel"
key object.RuntimeException
- if there is an error while deleting the CKDS entry.
-
hashCode
public int hashCode()Calculates a hash code value for this key object. Objects that are equal will also have the same hash value. -
equals
Performs a deep compare to determine whether the given object represents a key identical to the key represented by this object. -
cleaner
protected void cleaner()Call the class IBMJCECCACleaner to clean up the bytes of this key, ICSF token, or CKDS label.
-