public interface Crypto
Modifier and Type | Method and Description |
---|---|
Hashids |
hashids()
Hashids salted using the application's secret.
|
byte[] |
hmacSha256(byte[] message)
Sign given message with the Application's secret using HMAC SHA-256.
|
byte[] |
hmacSha256(byte[] message, byte[] secret)
Sign given message with the given secret using HMAC SHA-256.
|
String |
hmacSha256Hex(CharSequence message)
Sign given message with the Application's secret using HMAC SHA-256.
|
String |
hmacSha256Hex(CharSequence message, String secret)
Sign given message with the given secret using HMAC SHA-256.
|
byte[] |
newSecret()
Generate a 256 bits long secret.
|
String |
newSecretBase64()
Generate a 256 bits long secret encoded in Base64.
|
String |
newSecretHex()
Generate a 256 bits long secret encoded in hexadecimal.
|
byte[] |
secret()
Application secret.
|
byte[] |
sha256(byte[] message)
Generate a hash of the given message using SHA-256.
|
byte[] |
sha256(CharSequence message)
Generate a hash of the given message using SHA-256.
|
String |
sha256Base64(CharSequence message)
Generate a hash of the given message using SHA-256.
|
String |
sha256Hex(CharSequence message)
Generate a hash of the given message using SHA-256.
|
byte[] secret()
byte[] newSecret()
String newSecretHex()
String newSecretBase64()
byte[] hmacSha256(byte[] message)
message
- Message to sign
byte[] hmacSha256(byte[] message, byte[] secret)
message
- Message to sign
secret
- Secret to use
String hmacSha256Hex(CharSequence message)
message
- Message to sign
String hmacSha256Hex(CharSequence message, String secret)
message
- Message to sign
secret
- Secret to use
byte[] sha256(byte[] message)
message
- Message to hash
byte[] sha256(CharSequence message)
message
- Message to hash
String sha256Hex(CharSequence message)
message
- Message to hash
String sha256Base64(CharSequence message)
message
- Message to hash
Hashids hashids()