Package org.qubership.atp.crypt.impl
Class DecryptorImpl
java.lang.Object
org.qubership.atp.crypt.impl.DecryptorImpl
- All Implemented Interfaces:
Decryptor
-
Constructor Summary
ConstructorsConstructorDescriptionDecryptorImpl(String transformation, CryptoProvider provider, Object key) Instantiates a new Decryptor. -
Method Summary
Modifier and TypeMethodDescriptionDecrypt encryptedData String.Decrypt encryptedData String.Decrypt and replace text if there is any encrypted data.decryptIfEncrypted(String encryptedData) Decrypt encryptedData String if it's encrypted.decryptIfEncrypted(String encryptedData, Object key) Decrypt encryptedData String if it's encrypted.booleanisEncrypted(String data) Check if String data parameter is encrypted or not.
-
Constructor Details
-
DecryptorImpl
Instantiates a new Decryptor.- Parameters:
provider- the provider
-
-
Method Details
-
isEncrypted
Description copied from interface:DecryptorCheck if String data parameter is encrypted or not.- Specified by:
isEncryptedin interfaceDecryptor- Parameters:
data- String to check- Returns:
- true if String is encrypted, otherwise false.
-
decrypt
Description copied from interface:DecryptorDecrypt encryptedData String.- Specified by:
decryptin interfaceDecryptor- Parameters:
encryptedData- String to be decrypted- Returns:
- decrypted String
- Throws:
AtpDecryptException- in case decryption problems.
-
decrypt
Description copied from interface:DecryptorDecrypt encryptedData String.- Specified by:
decryptin interfaceDecryptor- Parameters:
encryptedData- String to be decryptedkey- Key object- Returns:
- decrypted String
- Throws:
AtpDecryptException- in case decryption problems.
-
decryptIfEncrypted
Description copied from interface:DecryptorDecrypt encryptedData String if it's encrypted.- Specified by:
decryptIfEncryptedin interfaceDecryptor- Parameters:
encryptedData- String possibly encryptedkey- Key object- Returns:
- decrypted String if encryptedData was really encrypted, otherwise returns original string
- Throws:
AtpDecryptException- in case decryption problems.
-
decryptIfEncrypted
Description copied from interface:DecryptorDecrypt encryptedData String if it's encrypted.- Specified by:
decryptIfEncryptedin interfaceDecryptor- Parameters:
encryptedData- String possibly encrypted- Returns:
- decrypted String if encryptedData was really encrypted, otherwise returns original string
- Throws:
AtpDecryptException- in case decryption problems.
-
decryptEncryptedPlacesInString
Decrypt and replace text if there is any encrypted data.- Specified by:
decryptEncryptedPlacesInStringin interfaceDecryptor- Parameters:
text- - data for decrypting- Returns:
- - Decrypted text
- Throws:
AtpDecryptException- in case decryption problems.
-