public class VerificationUtils
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
private static byte[] |
iv |
限定符 | 构造器和说明 |
---|---|
private |
VerificationUtils() |
限定符和类型 | 方法和说明 |
---|---|
static byte[] |
base64Decode(java.lang.String input)
base64解密
|
static java.lang.String |
base64Encode(byte[] input)
base64加密
|
static java.lang.String |
byteToHex(byte[] buffer) |
static java.lang.String |
decrypt3DES(byte[] input,
java.lang.String key)
已过时。
|
static java.lang.String |
decryptAES(byte[] input,
java.lang.String key)
AES解密
|
private static java.lang.String |
encode(java.lang.String input,
java.lang.String type) |
static byte[] |
encryptAES(java.lang.String input,
java.lang.String key)
AES加密
|
static java.security.KeyPair |
generateKeyPair(int keySize,
java.security.SecureRandom secrand)
生成公钥私钥对
|
private static java.security.PrivateKey |
getPrivateKey(byte[] privateKey)
获取私钥对象
|
private static java.security.PublicKey |
getPublicKey(byte[] publicKey)
获取公钥对象
|
static java.lang.String |
getRandomNumber(int length) |
static java.lang.String |
getRandomString(java.lang.String text,
int length) |
static java.lang.String |
md5Encode(java.lang.String input)
md5加密
|
static byte[] |
privateKeySign(byte[] privateKey,
byte[] data)
私钥签名
|
static boolean |
publicKeyVerify(byte[] publicKey,
byte[] data,
byte[] sign)
公钥验证签名
|
static java.lang.String |
sha1Encode(java.lang.String input)
sha1加密
|
static java.lang.String |
sha256Encode(java.lang.String input)
sha256加密
|
static java.lang.String |
sha512Encode(java.lang.String input)
sha512加密
|
public static java.lang.String getRandomString(java.lang.String text, int length)
text
- length
- public static java.lang.String getRandomNumber(int length)
length
- public static java.security.KeyPair generateKeyPair(int keySize, java.security.SecureRandom secrand)
keySize
- secrand
- private static java.security.PublicKey getPublicKey(byte[] publicKey) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
publicKey
- java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException
private static java.security.PrivateKey getPrivateKey(byte[] privateKey) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
privateKey
- java.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException
public static boolean publicKeyVerify(byte[] publicKey, byte[] data, byte[] sign)
publicKey
- data
- sign
- public static byte[] privateKeySign(byte[] privateKey, byte[] data)
privateKey
- data
- public static java.lang.String md5Encode(java.lang.String input)
input
- public static java.lang.String sha1Encode(java.lang.String input)
input
- public static java.lang.String base64Encode(byte[] input)
input
- private static java.lang.String encode(java.lang.String input, java.lang.String type)
public static byte[] base64Decode(java.lang.String input)
input
- public static java.lang.String sha512Encode(java.lang.String input)
input
- public static java.lang.String sha256Encode(java.lang.String input)
input
- public static byte[] encryptAES(java.lang.String input, java.lang.String key)
input
- key
- public static java.lang.String decryptAES(byte[] input, java.lang.String key)
input
- key
- @Deprecated public static java.lang.String decrypt3DES(byte[] input, java.lang.String key)
input
- key
- public static java.lang.String byteToHex(byte[] buffer)
buffer
-