Constructor and Description |
---|
DefaultHMacEngine(String algorithm,
byte[] key)
构造
|
DefaultHMacEngine(String algorithm,
Key key)
构造
|
DefaultHMacEngine(String algorithm,
Key key,
AlgorithmParameterSpec spec)
构造
|
Modifier and Type | Method and Description |
---|---|
byte[] |
doFinal()
结束并生成摘要
|
String |
getAlgorithm()
获取当前算法
|
Mac |
getMac()
获得
Mac |
int |
getMacLength()
获取MAC算法块大小
|
DefaultHMacEngine |
init(String algorithm,
byte[] key)
初始化
|
DefaultHMacEngine |
init(String algorithm,
Key key)
初始化
|
DefaultHMacEngine |
init(String algorithm,
Key key,
AlgorithmParameterSpec spec)
初始化
|
void |
reset()
重置
|
void |
update(byte[] in)
加入需要被摘要的内容
|
void |
update(byte[] in,
int inOff,
int len)
加入需要被摘要的内容
|
public DefaultHMacEngine(String algorithm, byte[] key)
algorithm
- 算法key
- 密钥public DefaultHMacEngine(String algorithm, Key key)
algorithm
- 算法key
- 密钥public DefaultHMacEngine(String algorithm, Key key, AlgorithmParameterSpec spec)
algorithm
- 算法key
- 密钥spec
- AlgorithmParameterSpec
public DefaultHMacEngine init(String algorithm, byte[] key)
algorithm
- 算法key
- 密钥public DefaultHMacEngine init(String algorithm, Key key)
algorithm
- 算法key
- 密钥 SecretKey
CryptoException
- Cause by IOExceptionpublic DefaultHMacEngine init(String algorithm, Key key, AlgorithmParameterSpec spec)
algorithm
- 算法key
- 密钥 SecretKey
spec
- AlgorithmParameterSpec
CryptoException
- Cause by IOExceptionpublic void update(byte[] in)
MacEngine
public void update(byte[] in, int inOff, int len)
MacEngine
public byte[] doFinal()
MacEngine
public void reset()
MacEngine
public int getMacLength()
MacEngine
getMacLength
in interface MacEngine
public String getAlgorithm()
MacEngine
getAlgorithm
in interface MacEngine
Copyright © 2024. All rights reserved.