public class Crypto
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Crypto.HashType
Define a hash type enumeration for strong-typing
|
| Constructor and Description |
|---|
Crypto() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decryptAES(java.lang.String value)
Decrypt a String with the AES encryption standard using the application secret
|
static java.lang.String |
decryptAES(java.lang.String value,
java.lang.String privateKey)
Decrypt a String with the AES encryption standard.
|
static java.lang.String |
encryptAES(java.lang.String value)
Encrypt a String with the AES encryption standard using the application secret
|
static java.lang.String |
encryptAES(java.lang.String value,
java.lang.String privateKey)
Encrypt a String with the AES encryption standard.
|
static java.lang.String |
passwordHash(java.lang.String input)
Create a password hash using the default hashing algorithm
|
static java.lang.String |
passwordHash(java.lang.String input,
Crypto.HashType hashType)
Create a password hash using specific hashing algorithm
|
static java.lang.String |
sign(java.lang.String message)
Sign a message using the application secret key (HMAC-SHA1)
|
static java.lang.String |
sign(java.lang.String message,
byte[] key)
Sign a message with a key
|
public static java.lang.String sign(java.lang.String message)
message - the message to signpublic static java.lang.String sign(java.lang.String message,
byte[] key)
message - The message to signkey - The key to usepublic static java.lang.String passwordHash(java.lang.String input)
input - The passwordpublic static java.lang.String passwordHash(java.lang.String input,
Crypto.HashType hashType)
input - The passwordhashType - The hashing algorithmpublic static java.lang.String encryptAES(java.lang.String value)
value - The String to encryptpublic static java.lang.String encryptAES(java.lang.String value,
java.lang.String privateKey)
value - The String to encryptprivateKey - The key used to encryptpublic static java.lang.String decryptAES(java.lang.String value)
value - An hexadecimal encrypted stringpublic static java.lang.String decryptAES(java.lang.String value,
java.lang.String privateKey)
value - An hexadecimal encrypted stringprivateKey - The key used to encryptGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly