Class HMACKey
java.lang.Object
com.ibm.crypto.hdwrCCA.provider.HMACKey
- All Implemented Interfaces:
Serializable, Key, SecretKey, Destroyable
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleaner()Call the class IBMJCECCACleaner to clean up the bytes of this key, ICSF token, or CKDS label.voidDelete the CKDS entry associated with this key object.booleanPerforms 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.inthashCode()Calculates a hash code value for this key object.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:
getEncodedin 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:
getAlgorithmin interfaceKey- Returns:
- the HMAC algorithm name.
-
getFormat
-
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
-
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.
-