public class CryptoUtil extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CryptoUtil.Encryptor
This class provides the functionality of encryption and decryption with a specific cipher
key.
|
| 构造器和说明 |
|---|
CryptoUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static CryptoUtil.Encryptor |
newEncryptor()
Create an Encryptor instance using default cipher key.
|
static CryptoUtil.Encryptor |
newEncryptor(String key)
Create an
CryptoUtil.Encryptor instance using given cipher key. |
static byte[] |
sha1(byte[] bytes)
Compute hash value of given array of bytes.
|
static byte[] |
sha1(String text)
Compute hash value of given string.
|
public static CryptoUtil.Encryptor newEncryptor(String key)
CryptoUtil.Encryptor instance using given cipher key.key - Cipher key.CryptoUtil.Encryptor instance.public static CryptoUtil.Encryptor newEncryptor()
CryptoUtil.Encryptor instance.public static byte[] sha1(byte[] bytes)
bytes - The origin array of bytes.public static byte[] sha1(String text)
text - The origin string.Copyright © 2024. All rights reserved.