public final class CryptoUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static char[] |
key
Internal Key.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decrypt(java.lang.String ciphertext)
Decrypts cipher text using the shared passphrase.
|
static java.lang.String |
encrypt(java.lang.String cleartext)
Encrypts data.
|
protected static javax.crypto.SecretKey |
getKey()
Gets the key.
|
public static java.lang.String encrypt(java.lang.String cleartext)
cleartext
- the cleartextjava.security.GeneralSecurityException
- on an encryption errorpublic static java.lang.String decrypt(java.lang.String ciphertext)
ciphertext
- the ciphertextprotected static javax.crypto.SecretKey getKey() throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
- the general security exception