Class MaapiCrypto

Object
com.tailf.maapi.MaapiCrypto

public class MaapiCrypto extends Object
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 Details

  • Constructor Details

  • Method Details

    • getDes3Key

      public byte[] getDes3Key()
    • getDes3IV

      public byte[] getDes3IV()
    • getAesKey

      public byte[] getAesKey()
    • getAesIV

      public byte[] getAesIV()
    • getAes256Key

      public byte[] getAes256Key()
    • decrypt

      public String decrypt(String encrypted) throws MaapiException
      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

      public String encrypt(MaapiCryptoType type, String plaintext) throws MaapiException
      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.