public class CodeCryptUtils extends Object
| 构造器和说明 |
|---|
CodeCryptUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static com.abasecode.opencode.base.code.CodeResult |
decryptData(SafeResult result,
String key,
String iv)
decrypt SafeResult to CodeResult
|
private static Map<String,Object> |
decryptString2Map(String data,
String key,
String iv)
decrypt string 2 map
|
private static String |
encrypt2String(Map<String,Object> map,
String key,
String iv)
encrypt map 2 string
|
static SafeResult |
encryptData(com.abasecode.opencode.base.code.CodeResult result,
String key,
String iv,
String secret)
encrypt CodeResult 2 SafeResult
|
static String |
getMd5(String txt)
get md5
|
static String |
getSha(String txt)
get sha1
|
static String |
sign(Map<String,Object> data,
String secret)
get sign
|
static boolean |
signVerify(String sign,
String data,
String key,
String iv)
verify sign
|
private static String encrypt2String(Map<String,Object> map, String key, String iv) throws Exception
map - key - iv - Exceptionprivate static Map<String,Object> decryptString2Map(String data, String key, String iv) throws Exception
data - key - iv - Exceptionpublic static com.abasecode.opencode.base.code.CodeResult decryptData(SafeResult result, String key, String iv) throws Exception
result - key - iv - Exceptionpublic static SafeResult encryptData(com.abasecode.opencode.base.code.CodeResult result, String key, String iv, String secret) throws Exception
result - key - iv - secret - Exceptionpublic static String sign(Map<String,Object> data, String secret) throws NoSuchAlgorithmException
data - secret - NoSuchAlgorithmExceptionpublic static boolean signVerify(String sign, String data, String key, String iv) throws Exception
sign - data - key - iv - Exceptionpublic static String getSha(String txt) throws NoSuchAlgorithmException
txt - NoSuchAlgorithmExceptionpublic static String getMd5(String txt) throws NoSuchAlgorithmException
txt - NoSuchAlgorithmExceptionCopyright © 2023. All rights reserved.