public class DigestHelper extends Object
构造器和说明 |
---|
DigestHelper() |
限定符和类型 | 方法和说明 |
---|---|
static String |
digest(byte[] buf,
String algorithm)
获取信息摘要
|
static byte[] |
digestBuff(byte[] buf,
String algorithm) |
static byte[] |
hmac(byte[] content,
byte[] key) |
static byte[] |
hmac(byte[] content,
byte[] key,
String algorithm) |
static String |
hmac(String content,
String key) |
static String |
hmac(String content,
String key,
String algorithm) |
static String |
hmac(String content,
String key,
String algorithm,
String encoding) |
static String |
md5(byte[] content) |
static String |
sha1(byte[] content) |
static String |
sha256(byte[] content) |
public static String digest(byte[] buf, String algorithm)
buf
- 内容algorithm
- 摘要算法public static byte[] digestBuff(byte[] buf, String algorithm)
public static String sha1(byte[] content)
public static String sha256(byte[] content)
public static String md5(byte[] content)
public static byte[] hmac(byte[] content, byte[] key, String algorithm) throws NoSuchAlgorithmException, InvalidKeyException
public static byte[] hmac(byte[] content, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException
public static String hmac(String content, String key, String algorithm, String encoding) throws UnsupportedEncodingException, InvalidKeyException, NoSuchAlgorithmException
public static String hmac(String content, String key, String algorithm) throws UnsupportedEncodingException, InvalidKeyException, NoSuchAlgorithmException
public static String hmac(String content, String key) throws UnsupportedEncodingException, NoSuchAlgorithmException, InvalidKeyException
Copyright © 2018. All rights reserved.