Package com.tailf.maapi
Class MaapiCrypto
Object
com.tailf.maapi.MaapiCrypto
Data encryption and decryption utility class.
This class is instantiated using an existing Maapi
object.
Encrypted strings can then be decrypted via the
decrypt(String)
method and encrypted via the
encrypt(MaapiCryptoType, String)
method.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDecrypt an encrypted string.encrypt
(MaapiCryptoType type, String plaintext) Encrypt a plaintext string.byte[]
byte[]
getAesIV()
byte[]
byte[]
byte[]
-
Field Details
-
UNENCRYPTED_PREFIX
- See Also:
-
-
Constructor Details
-
MaapiCrypto
- Throws:
MaapiException
-
-
Method Details
-
getDes3Key
public byte[] getDes3Key() -
getDes3IV
public byte[] getDes3IV() -
getAesKey
public byte[] getAesKey() -
getAesIV
public byte[] getAesIV() -
getAes256Key
public byte[] getAes256Key() -
decrypt
Decrypt an encrypted string.- Parameters:
encrypted
- The encrypted string to decrypt.- Returns:
- The plaintext value after decrypting the encrypted string.
- Throws:
MaapiException
- On errors decrypting the encrypted string.
-
encrypt
Encrypt a plaintext string.- Parameters:
plaintext
- The plaintext to encrypt.- Returns:
- The encrypted value after encrypting the plaintext.
- Throws:
MaapiException
- On errors encrypting the plaintext.
-