Constructor and Description |
---|
DefaultHMacEngine(String algorithm,
byte[] key)
构造
|
DefaultHMacEngine(String algorithm,
Key key)
构造
|
Modifier and Type | Method and Description |
---|---|
byte[] |
digest(InputStream data,
int bufferLength)
生成摘要
|
String |
getAlgorithm()
获取当前算法
|
Mac |
getMac()
获得
Mac |
int |
getMacLength()
获取MAC算法块大小
|
DefaultHMacEngine |
init(String algorithm,
byte[] key)
初始化
|
DefaultHMacEngine |
init(String algorithm,
Key key)
初始化
|
public DefaultHMacEngine(String algorithm, byte[] key)
algorithm
- 算法key
- 密钥public DefaultHMacEngine init(String algorithm, byte[] key)
algorithm
- 算法key
- 密钥public DefaultHMacEngine init(String algorithm, Key key)
algorithm
- 算法key
- 密钥 SecretKey
CryptoException
- Cause by IOExceptionpublic byte[] digest(InputStream data, int bufferLength)
MacEngine
digest
in interface MacEngine
data
- InputStream
数据流bufferLength
- 缓存长度,不足1使用 NioUtil.DEFAULT_BUFFER_SIZE
做为默认值public int getMacLength()
MacEngine
getMacLength
in interface MacEngine
public String getAlgorithm()
MacEngine
getAlgorithm
in interface MacEngine
Copyright © 2021. All rights reserved.