|
Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10696-05 |
||||||||
| 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
MACinitialize in class MACalgID - 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
MessageDigestsetAlgID in class MessageDigestalgID - The AlgorithmIdentifier to use.AlgorithmIdentifierExceptionpublic AlgorithmIdentifier getAlgID()
MessageDigestgetAlgID in class MessageDigest
public void setKey(byte[] key,
int keyOff,
int keyLen)
public void setKey(byte[] key)
public void init()
init in class MessageDigestpublic void update(byte b)
update in class MessageDigest
public void update(byte[] input,
int off,
int len)
update in class MessageDigestinput - 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 MessageDigestpublic java.lang.String algName()
algName in class MessageDigestpublic int blockSize()
MessageDigestblockSize in class MessageDigestpublic int getDigestLength()
MessageDigestgetDigestLength in class MessageDigestpublic byte[] getDigestBits()
getDigestBits in class MessageDigestpublic boolean isValid()
true if this HMAC is in a valid state and its digest bits are usable; otherwise returns false.isValid in class MessageDigestpublic void erase()
erase in class MACpublic void finalize()
finalize in class java.lang.Objectpublic java.lang.Object clone()
clone in class MessageDigestprotected MessageDigest.MDState getState()
MessageDigestgetState in class MessageDigestprotected void setState(MessageDigest.MDState state)
MessageDigestsetState in class MessageDigest
|
Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10696-05 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||