本文整理了Java中org.bouncycastle.crypto.macs.HMac.<init>()
方法的一些代码示例,展示了HMac.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HMac.<init>()
方法的具体详情如下:
包路径:org.bouncycastle.crypto.macs.HMac
类名称:HMac
方法名:<init>
[英]Base constructor for one of the standard digest algorithms that the byteLength of the algorithm is know for.
[中]标准摘要算法之一的基构造函数,该算法的字节长度是已知的。
代码示例来源:origin: web3j/web3j
public static byte[] hmacSha512(byte[] key, byte[] input) {
HMac hMac = new HMac(new SHA512Digest());
hMac.init(new KeyParameter(key));
hMac.update(input, 0, input.length);
byte[] out = new byte[64];
hMac.doFinal(out, 0);
return out;
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
/**
* Creates a HKDFBytesGenerator based on the given hash function.
*
* @param hash the digest to be used as the source of generatedBytes bytes
*/
public HKDFBytesGenerator(Digest hash)
{
this.hMacHash = new HMac(hash);
this.hashLen = hash.getDigestSize();
}
代码示例来源:origin: redfish64/TinyTravelTracker
public PKCS5S2ParametersGenerator(Digest digest)
{
hMac = new HMac(digest);
state = new byte[hMac.getMacSize()];
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac_256_256()
{
super(new HMac(new SkeinDigest(SkeinDigest.SKEIN_256, 256)));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac()
{
super(new HMac(new SHA256Digest()));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac()
{
super(new HMac(new MD4Digest()));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac256()
{
super(new HMac(new KeccakDigest(256)));
}
}
代码示例来源:origin: com.hierynomus/smbj
@Override
public org.bouncycastle.crypto.Mac create() {
return new HMac(new MD5Digest());
}
});
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac2012_256()
{
super(new HMac(new GOST3411_2012_256Digest()));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac_256_128()
{
super(new HMac(new SkeinDigest(SkeinDigest.SKEIN_256, 128)));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac_512_384()
{
super(new HMac(new SkeinDigest(SkeinDigest.SKEIN_512, 384)));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac()
{
super(new HMac(new WhirlpoolDigest()));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac()
{
super(new HMac(new RIPEMD160Digest()));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac()
{
super(new HMac(new RIPEMD256Digest()));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac224()
{
super(new HMac(new KeccakDigest(224)));
}
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public HashMac()
{
super(new HMac(new RIPEMD128Digest()));
}
}
代码示例来源:origin: NemProject/nem.core
private static IESEngine createIesEngine() {
return new IESEngine(
new ECDHBasicAgreement(),
new KDF2BytesGenerator(new SHA1Digest()),
new HMac(new SHA1Digest()));
}
}
代码示例来源:origin: de.schlichtherle.truezip/truezip-driver-tzp
@Override
public void authenticate() throws IOException {
final Mac mac = new HMac(new SHA256Digest());
mac.init(sha256MacParam);
final byte[] buf = computeMac(mac);
assert buf.length == mac.getMacSize();
if (!ArrayHelper.equals(buf, 0, footer, footer.length / 2, footer.length / 2))
throw new RaesAuthenticationException();
}
}
代码示例来源:origin: net.aholbrook.paseto/crypto-v1-bc
@Override
public byte[] hmacSha384(byte[] m, byte[] key) {
validateHmacSha384(m, key);
Digest digest = new SHA384Digest();
HMac hmac = new HMac(digest);
hmac.init(new KeyParameter(key));
byte[] out = new byte[hmac.getMacSize()];
hmac.update(m, 0, m.length);
hmac.doFinal(out, 0);
return out;
}
代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on
public IESwithDESedeCBC()
{
super(new IESEngine(new DHBasicAgreement(),
new KDF2BytesGenerator(DigestFactory.createSHA1()),
new HMac(DigestFactory.createSHA1()),
new PaddedBufferedBlockCipher(new CBCBlockCipher(new DESedeEngine()))), 8);
}
}
内容来源于网络,如有侵权,请联系作者删除!