public class CryptoUtil extends Object
| Constructor and Description |
|---|
CryptoUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
decrypt(String encodedKey,
String encodedInput) |
static String |
decryptWithPassword(String password,
String input) |
static String |
encrypt(String encodedKey,
String encodedInput) |
static String |
encryptWithPassword(String password,
String input) |
static String |
genAESKey() |
static Keys |
generateKeys() |
static String |
hash(byte[] contentBytes) |
static String |
hash(String str) |
static String |
makeBlankString(int len) |
static X509Certificate |
signCert(KeyPair pair,
String name,
X509Certificate caCert,
PrivateKey caKey) |
static String |
toHex(byte[] data) |
static String |
toHex(byte[] data,
int length) |
public static String genAESKey() throws RuntimeException
RuntimeExceptionpublic static Keys generateKeys() throws RuntimeException
RuntimeExceptionpublic static String encrypt(String encodedKey, String encodedInput) throws RuntimeException
RuntimeExceptionpublic static String encryptWithPassword(String password, String input) throws RuntimeException
RuntimeExceptionpublic static String decryptWithPassword(String password, String input) throws RuntimeException
RuntimeExceptionpublic static String decrypt(String encodedKey, String encodedInput) throws RuntimeException
RuntimeExceptionpublic static String hash(String str) throws RuntimeException
RuntimeExceptionpublic static String hash(byte[] contentBytes) throws RuntimeException
RuntimeExceptionpublic static X509Certificate signCert(KeyPair pair, String name, X509Certificate caCert, PrivateKey caKey) throws Exception
Exceptionpublic static String toHex(byte[] data, int length)
public static String toHex(byte[] data)
public static String makeBlankString(int len)
Copyright © 2017. All rights reserved.