public class MaapiCrypto extends Object
This class is instantiated using an existing Maapi
object.
Encrypted strings can then be decrypted via the
MaapiCrypto.decrypt(String)
method and encrypted via the
MaapiCrypto.encrypt(MaapiCryptoType, String)
method.
Modifier and Type | Field and Description |
---|---|
static String |
UNENCRYPTED_PREFIX |
Constructor and Description |
---|
MaapiCrypto(Maapi maapi) |
Modifier and Type | Method and Description |
---|---|
String |
decrypt(String encrypted)
Decrypt an encrypted string.
|
String |
encrypt(MaapiCryptoType type,
String plaintext)
Encrypt a plaintext string.
|
byte[] |
getAes256Key() |
byte[] |
getAesIV() |
byte[] |
getAesKey() |
byte[] |
getDes3IV() |
byte[] |
getDes3Key() |
public static final String UNENCRYPTED_PREFIX
public MaapiCrypto(Maapi maapi) throws MaapiException
MaapiException
public byte[] getDes3Key()
public byte[] getDes3IV()
public byte[] getAesKey()
public byte[] getAesIV()
public byte[] getAes256Key()
public String decrypt(String encrypted) throws MaapiException
encrypted
- The encrypted string to decrypt.MaapiException
- On errors decrypting the encrypted string.public String encrypt(MaapiCryptoType type, String plaintext) throws MaapiException
plaintext
- The plaintext to encrypt.MaapiException
- On errors encrypting the plaintext.