public final class Algorithms extends Object
| Modifier | Constructor and Description |
|---|---|
private |
Algorithms() |
| Modifier and Type | Method and Description |
|---|---|
static String |
aesDecode(byte[] aesKey,
String associatedData,
String nonce,
String ciphertext)
解密响应体.
|
static String |
hmacSha256Hex(String src,
String secret,
boolean upperCase)
Hmac_sha256
|
static String |
md5Hex(byte[] src,
boolean upperCase)
Md 5 hex string.
|
static String |
md5Hex(String src,
boolean upperCase)
Md5 hex
|
static String |
sha1Hex(String format)
Sha1 hex.
|
static String |
sha1Signature(String token,
String timestamp,
String nonce,
String encrypt)
用SHA1算法生成安全签名
|
public static String sha1Signature(String token, String timestamp, String nonce, String encrypt) throws IllegalArgumentException
token - 票据timestamp - 时间戳nonce - 随机字符串encrypt - 密文IllegalArgumentException - the aes exceptionpublic static String sha1Hex(String format)
format - the formatpublic static String hmacSha256Hex(String src, String secret, boolean upperCase)
src - the srcsecret - the secretupperCase - the upper casepublic static String md5Hex(String src, boolean upperCase)
src - the srcupperCase - the upper casepublic static String md5Hex(byte[] src, boolean upperCase)
src - the srcupperCase - the upper caseCopyright © 2024. All rights reserved.