Constructor and Description |
---|
BCHMacEngine(org.bouncycastle.crypto.Digest digest,
byte[] key)
构造
|
BCHMacEngine(org.bouncycastle.crypto.Digest digest,
org.bouncycastle.crypto.CipherParameters params)
构造
|
Modifier and Type | Method and Description |
---|---|
byte[] |
digest(InputStream data,
int bufferLength)
生成摘要
|
String |
getAlgorithm()
获取当前算法
|
org.bouncycastle.crypto.Mac |
getMac()
获得
Mac |
int |
getMacLength()
获取MAC算法块大小
|
BCHMacEngine |
init(org.bouncycastle.crypto.Digest digest,
org.bouncycastle.crypto.CipherParameters params)
初始化
|
public BCHMacEngine(org.bouncycastle.crypto.Digest digest, byte[] key)
digest
- 摘要算法,为Digest
的接口实现key
- 密钥public BCHMacEngine(org.bouncycastle.crypto.Digest digest, org.bouncycastle.crypto.CipherParameters params)
digest
- 摘要算法params
- 参数,例如密钥可以用KeyParameter
public BCHMacEngine init(org.bouncycastle.crypto.Digest digest, org.bouncycastle.crypto.CipherParameters params)
digest
- 摘要算法params
- 参数,例如密钥可以用KeyParameter
public byte[] digest(InputStream data, int bufferLength)
MacEngine
digest
in interface MacEngine
data
- InputStream
数据流bufferLength
- 缓存长度,不足1使用 NioUtil.DEFAULT_BUFFER_SIZE
做为默认值public org.bouncycastle.crypto.Mac getMac()
Mac
Mac
public int getMacLength()
MacEngine
getMacLength
in interface MacEngine
public String getAlgorithm()
MacEngine
getAlgorithm
in interface MacEngine
Copyright © 2021. All rights reserved.