abstract class HmacCore extends MacSpi implements Cloneable
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HmacCore.HmacSM3 |
| 限定符和类型 | 字段和说明 |
|---|---|
private int |
blockLen |
private boolean |
first |
private byte[] |
k_ipad |
private byte[] |
k_opad |
private MessageDigest |
md |
| 构造器和说明 |
|---|
HmacCore(MessageDigest md,
int bl)
Standard constructor, creates a new HmacCore instance using the
specified MessageDigest object.
|
HmacCore(String digestAlgorithm,
int bl)
Standard constructor, creates a new HmacCore instance instantiating
a MessageDigest of the specified name.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
clone() |
protected byte[] |
engineDoFinal()
Completes the HMAC computation and resets the HMAC for further use,
maintaining the secret key that the HMAC was initialized with.
|
protected int |
engineGetMacLength()
Returns the length of the HMAC in bytes.
|
protected void |
engineInit(Key key,
AlgorithmParameterSpec params)
Initializes the HMAC with the given secret key and algorithm parameters.
|
protected void |
engineReset()
Resets the HMAC for further use, maintaining the secret key that the
HMAC was initialized with.
|
protected void |
engineUpdate(byte input)
Processes the given byte.
|
protected void |
engineUpdate(byte[] input,
int offset,
int len)
Processes the first
len bytes in input,
starting at offset. |
protected void |
engineUpdate(ByteBuffer input)
Processes the
input.remaining() bytes in the ByteBuffer
input. |
private MessageDigest md
private byte[] k_ipad
private byte[] k_opad
private boolean first
private final int blockLen
HmacCore(MessageDigest md, int bl)
HmacCore(String digestAlgorithm, int bl) throws NoSuchAlgorithmException
protected int engineGetMacLength()
engineGetMacLength 在类中 MacSpiprotected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException
engineInit 在类中 MacSpikey - the secret key.params - the algorithm parameters.InvalidKeyException - if the given key is inappropriate for
initializing this MAC.InvalidAlgorithmParameterException - if the given algorithm
parameters are inappropriate for this MAC.protected void engineUpdate(byte input)
engineUpdate 在类中 MacSpiinput - the input byte to be processed.protected void engineUpdate(byte[] input,
int offset,
int len)
len bytes in input,
starting at offset.engineUpdate 在类中 MacSpiinput - the input buffer.offset - the offset in input where the input starts.len - the number of bytes to process.protected void engineUpdate(ByteBuffer input)
input.remaining() bytes in the ByteBuffer
input.engineUpdate 在类中 MacSpiinput - the input byte buffer.protected byte[] engineDoFinal()
engineDoFinal 在类中 MacSpiprotected void engineReset()
engineReset 在类中 MacSpipublic Object clone() throws CloneNotSupportedException
clone 在类中 MacSpiCloneNotSupportedExceptionCopyright © 2024. All rights reserved.