|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.crypto.core.MessageDigest
oracle.security.crypto.core.MAC
oracle.security.crypto.core.HMAC
public final class HMAC
This class implements HMAC [RFC2104] as a subclass of MessageDigest. MD5 and SHA are supported.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.security.crypto.core.MessageDigest |
---|
MessageDigest.MDState |
Field Summary |
---|
Fields inherited from class oracle.security.crypto.core.MessageDigest |
---|
algID |
Constructor Summary | |
---|---|
HMAC() Empty constructor. |
|
HMAC(AlgorithmIdentifier hashAlgID, byte[] key) Deprecated. |
|
HMAC(AlgorithmIdentifier hashAlgID, byte[] key, int keyOff, int keyLen) Deprecated. |
|
HMAC(AlgorithmIdentifier hashAlgID, SymmetricKey key) Creates a new HMAC object with the specified parameters. |
Method Summary | |
---|---|
java.lang.String |
algName() Returns the algorithm name of this HMAC. |
int |
blockSize() Returns the blocksize of this instance. |
java.lang.Object |
clone() Returns a clone of this HMAC object. |
void |
computeCurrent() Completes the hash computation, performing any necessary operations such as padding. |
void |
erase() Erases the keyBytes from this instance. |
void |
finalize() Finalizes this object by erasing sensitive data. |
AlgorithmIdentifier |
getAlgID() Returns the algorithm identifier of this object. |
byte[] |
getDigestBits() Returns a copy of the current digest bytes. |
int |
getDigestLength() Returns the length in bytes of the message digest. |
protected MessageDigest.MDState |
getState() Gets the state of this MessageDigest instance. |
void |
init() Resets this HMAC object to its initial state. |
void |
initialize(AlgorithmIdentifier algID, SymmetricKey key) Initializes this MAC with the specified parameter. |
boolean |
isValid() Returns true if this HMAC is in a valid state and its digest bits are usable; otherwise returns false . |
void |
setAlgID(AlgorithmIdentifier algID) Deprecated. Use initialize instead |
void |
setKey(byte[] key) Deprecated. Use initialize instead |
void |
setKey(byte[] key, int keyOff, int keyLen) Deprecated. Use initialize instead |
protected void |
setState(MessageDigest.MDState state) Sets the state of this MessageDigest instance. |
void |
update(byte b) Adds the specifed byte to the data being digested. |
void |
update(byte[] input, int off, int len) Adds the specified sequence of bytes to the data being digested. |
Methods inherited from class oracle.security.crypto.core.MAC |
---|
computeMAC, computeMAC, getInstance, verifyMAC, verifyMAC |
Methods inherited from class oracle.security.crypto.core.MessageDigest |
---|
computeDigest, computeDigest, getInstance, isEqual, toString, update, update, update, update, update, update, update, update, update, update, update, updateASCII |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HMAC()
public HMAC(AlgorithmIdentifier hashAlgID, SymmetricKey key) throws AlgorithmIdentifierException
hashAlgID
- The hash algorithm to use in this HMAC instance.key
- The key to use.AlgorithmIdentifierException
public HMAC(AlgorithmIdentifier hashAlgID, byte[] key, int keyOff, int keyLen) throws AlgorithmIdentifierException
AlgorithmIdentifierException
public HMAC(AlgorithmIdentifier hashAlgID, byte[] key) throws AlgorithmIdentifierException
AlgorithmIdentifierException
Method Detail |
---|
public void initialize(AlgorithmIdentifier algID, SymmetricKey key) throws AlgorithmIdentifierException
MAC
initialize
in class MAC
algID
- The MAC algorithm.key
- The key to use in this MAC. The key bytes will be cloned when initialized.AlgorithmIdentifierException
public void setAlgID(AlgorithmIdentifier algID) throws AlgorithmIdentifierException
MessageDigest
setAlgID
in class MessageDigest
algID
- The AlgorithmIdentifier to use.AlgorithmIdentifierException
public AlgorithmIdentifier getAlgID()
MessageDigest
getAlgID
in class MessageDigest
public void setKey(byte[] key, int keyOff, int keyLen)
public void setKey(byte[] key)
public void init()
init
in class MessageDigest
public void update(byte b)
update
in class MessageDigest
public void update(byte[] input, int off, int len)
update
in class MessageDigest
input
- the input arrayoff
- start position in the input arraylen
- the number of input array elements to add to the data being digestedpublic void computeCurrent()
getDigestBits()
.computeCurrent
in class MessageDigest
public java.lang.String algName()
algName
in class MessageDigest
public int blockSize()
MessageDigest
blockSize
in class MessageDigest
public int getDigestLength()
MessageDigest
getDigestLength
in class MessageDigest
public byte[] getDigestBits()
getDigestBits
in class MessageDigest
public boolean isValid()
true
if this HMAC
is in a valid state and its digest bits are usable; otherwise returns false
.isValid
in class MessageDigest
public void erase()
erase
in class MAC
public void finalize()
finalize
in class java.lang.Object
public java.lang.Object clone()
clone
in class MessageDigest
protected MessageDigest.MDState getState()
MessageDigest
getState
in class MessageDigest
protected void setState(MessageDigest.MDState state)
MessageDigest
setState
in class MessageDigest
|
Oracle Security Developer Tools Crypto Java API Reference 11g (11.1.1) E10668-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |