org.bouncycastle.crypto.macs.HMac.reset()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中org.bouncycastle.crypto.macs.HMac.reset()方法的一些代码示例,展示了HMac.reset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HMac.reset()方法的具体详情如下:
包路径:org.bouncycastle.crypto.macs.HMac
类名称:HMac
方法名:reset

HMac.reset介绍

[英]Reset the mac generator.
[中]重置mac生成器。

代码示例

代码示例来源:origin: org.xipki/security

@Override
public OutputStream getOutputStream() {
 hmac.reset();
 return outputStream;
}

代码示例来源:origin: org.xipki.tk/security

@Override
public OutputStream getOutputStream() {
  hmac.reset();
  return outputStream;
}

代码示例来源:origin: encryptedsystems/Clusion

public static byte[] generateHmac(byte[] key, String msg) throws UnsupportedEncodingException {
  HMac hmac = new HMac(new SHA256Digest());
  byte[] result = new byte[hmac.getMacSize()];
  byte[] msgAry = msg.getBytes("UTF-8");
  hmac.init(new KeyParameter(key));
  hmac.reset();
  hmac.update(msgAry, 0, msgAry.length);
  hmac.doFinal(result, 0);
  return result;
}

代码示例来源:origin: encryptedsystems/Clusion

public static byte[] generateHmac512(byte[] key, String msg) throws UnsupportedEncodingException {
  HMac hmac = new HMac(new SHA512Digest());
  byte[] result = new byte[hmac.getMacSize()];
  byte[] msgAry = msg.getBytes("UTF-8");
  hmac.init(new KeyParameter(key));
  hmac.reset();
  hmac.update(msgAry, 0, msgAry.length);
  hmac.doFinal(result, 0);
  return result;
}

代码示例来源:origin: encryptedsystems/Clusion

public static byte[] generateHmac(byte[] key, byte[] msg) throws UnsupportedEncodingException {
  HMac hmac = new HMac(new SHA256Digest());
  byte[] result = new byte[hmac.getMacSize()];
  hmac.init(new KeyParameter(key));
  hmac.reset();
  hmac.update(msg, 0, msg.length);
  hmac.doFinal(result, 0);
  return result;
}

相关文章