Class DecryptorImpl

java.lang.Object
org.qubership.atp.crypt.impl.DecryptorImpl
All Implemented Interfaces:
Decryptor

public class DecryptorImpl extends Object implements Decryptor
  • Constructor Details

    • DecryptorImpl

      public DecryptorImpl(String transformation, CryptoProvider provider, Object key)
      Instantiates a new Decryptor.
      Parameters:
      provider - the provider
  • Method Details

    • isEncrypted

      public boolean isEncrypted(String data)
      Description copied from interface: Decryptor
      Check if String data parameter is encrypted or not.
      Specified by:
      isEncrypted in interface Decryptor
      Parameters:
      data - String to check
      Returns:
      true if String is encrypted, otherwise false.
    • decrypt

      public String decrypt(String encryptedData) throws AtpDecryptException
      Description copied from interface: Decryptor
      Decrypt encryptedData String.
      Specified by:
      decrypt in interface Decryptor
      Parameters:
      encryptedData - String to be decrypted
      Returns:
      decrypted String
      Throws:
      AtpDecryptException - in case decryption problems.
    • decrypt

      public String decrypt(String encryptedData, Object key) throws AtpDecryptException
      Description copied from interface: Decryptor
      Decrypt encryptedData String.
      Specified by:
      decrypt in interface Decryptor
      Parameters:
      encryptedData - String to be decrypted
      key - Key object
      Returns:
      decrypted String
      Throws:
      AtpDecryptException - in case decryption problems.
    • decryptIfEncrypted

      public String decryptIfEncrypted(String encryptedData, Object key) throws AtpDecryptException
      Description copied from interface: Decryptor
      Decrypt encryptedData String if it's encrypted.
      Specified by:
      decryptIfEncrypted in interface Decryptor
      Parameters:
      encryptedData - String possibly encrypted
      key - Key object
      Returns:
      decrypted String if encryptedData was really encrypted, otherwise returns original string
      Throws:
      AtpDecryptException - in case decryption problems.
    • decryptIfEncrypted

      public String decryptIfEncrypted(String encryptedData) throws AtpDecryptException
      Description copied from interface: Decryptor
      Decrypt encryptedData String if it's encrypted.
      Specified by:
      decryptIfEncrypted in interface Decryptor
      Parameters:
      encryptedData - String possibly encrypted
      Returns:
      decrypted String if encryptedData was really encrypted, otherwise returns original string
      Throws:
      AtpDecryptException - in case decryption problems.
    • decryptEncryptedPlacesInString

      public String decryptEncryptedPlacesInString(String text) throws AtpDecryptException
      Decrypt and replace text if there is any encrypted data.
      Specified by:
      decryptEncryptedPlacesInString in interface Decryptor
      Parameters:
      text - - data for decrypting
      Returns:
      - Decrypted text
      Throws:
      AtpDecryptException - in case decryption problems.