Package org.qubership.atp.crypt.api
Interface CryptoProvider
- All Known Implementing Classes:
BouncyCastleProvider
public interface CryptoProvider
-
Method Summary
Modifier and TypeMethodDescriptionDecrypt String data using transformation and key provided.Encrypt String data using transformation and key provided.Generate Keys.booleanisEncrypted(String data) Check if String data parameter is encrypted or not.Read key from string parameter.readPrivateKey(String privateKey) Read private key from string parameter.readPublicKey(String publicKey) Read public key from string parameter.
-
Method Details
-
generateKeys
Generate Keys.- Returns:
- KeyEntity containing generated keys
- Throws:
Exception- in case some encryption problems.
-
readPublicKey
Read public key from string parameter.- Parameters:
publicKey- String to read key- Returns:
- Object - public key read
- Throws:
Exception- in case some encryption problems.
-
readPrivateKey
Read private key from string parameter.- Parameters:
privateKey- String to read key- Returns:
- Object - private key read
- Throws:
Exception- in case some encryption problems.
-
readKey
Read key from string parameter.- Parameters:
key- String to read key- Returns:
- Object - key read
- Throws:
Exception- in case some encryption problems.
-
encrypt
Encrypt String data using transformation and key provided.- Parameters:
transformation- Name of transformation, as used in javax.crypto.Cipherdata- String to be encryptedkey- Key object- Returns:
- String - encrypted String
- Throws:
Exception- in case some encryption problems.
-
decrypt
Decrypt String data using transformation and key provided.- Parameters:
transformation- Name of transformation, as used in javax.crypto.Cipherdata- String to be decryptedkey- Key object- Returns:
- String - decrypted String
- Throws:
Exception- in case some encryption problems.
-
isEncrypted
Check if String data parameter is encrypted or not.- Parameters:
data- String to check- Returns:
- true if String is encrypted, otherwise false.
-