public final class Crypto extends Object
| Constructor and Description |
|---|
Crypto()
Construct a Crypto instance with the default encryption provider.
|
Crypto(KeyProvider keyProvider)
Construct a Crypto instance with the given encryption provider.
|
| Modifier and Type | Method and Description |
|---|---|
String |
decrypt(String secret)
Decrypts the provided secret.
|
String |
encrypt(String secret)
Encrypt the provided secret.
|
public Crypto()
public Crypto(KeyProvider keyProvider)
keyProvider - The encryption provider to use.public String encrypt(String secret) throws GeneralSecurityException
secret - The password or other secret to encrypt.GeneralSecurityException - If something goes wrong with the encryption (wrong key size/algorithm/etc).public String decrypt(String secret) throws GeneralSecurityException
secret - The password or other secret to decrypt.GeneralSecurityException - If something goes wrong with the encryption (wrong key size/algorithm/etc).Copyright © 2017 SDL Group. All rights reserved.