Class ClientEciesEncryptor
java.lang.Object
io.getlime.security.powerauth.crypto.lib.encryptor.ecies.ClientEciesEncryptor
- All Implemented Interfaces:
ClientEncryptor
Class implements ECIES encryption for PowerAuth clients.
PowerAuth protocol versions:
- 3.0
- 3.1
- 3.2
-
Constructor Summary
ConstructorsConstructorDescriptionClientEciesEncryptor(EncryptorId encryptorId, EncryptorParameters parameters) Construct ECIES encryptor that implements encryption for PowerAuth Clients. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermine whether encrypted response data can be decrypted.booleanDetermine whether request data can be encrypted.voidconfigureSecrets(EncryptorSecrets secrets) Configure secret keys before the encryptor is used for the encryption and decryption tasks.byte[]decryptResponse(EncryptedResponse response) Decrypt response received from the server.encryptRequest(byte[] data) Encrypt data with this encryptor.Get this encryptor's identifier.Get parameters used to construct this encryptor.
-
Constructor Details
-
ClientEciesEncryptor
public ClientEciesEncryptor(EncryptorId encryptorId, EncryptorParameters parameters) throws EncryptorException Construct ECIES encryptor that implements encryption for PowerAuth Clients.- Parameters:
encryptorId- Encryptor identifier.parameters- Encryptor parameters.- Throws:
EncryptorException- In case that protocol is not supported.
-
-
Method Details
-
getEncryptorParameters
Description copied from interface:ClientEncryptorGet parameters used to construct this encryptor.- Specified by:
getEncryptorParametersin interfaceClientEncryptor- Returns:
- EncryptorParameters used to construct this encryptor.
-
getEncryptorId
Description copied from interface:ClientEncryptorGet this encryptor's identifier.- Specified by:
getEncryptorIdin interfaceClientEncryptor- Returns:
- This encryptor's identifier.
-
configureSecrets
Description copied from interface:ClientEncryptorConfigure secret keys before the encryptor is used for the encryption and decryption tasks.- Specified by:
configureSecretsin interfaceClientEncryptor- Parameters:
secrets- Object representing a secret keys for particular protocol version.- Throws:
EncryptorException- In case of failure.
-
canEncryptRequest
public boolean canEncryptRequest()Description copied from interface:ClientEncryptorDetermine whether request data can be encrypted.- Specified by:
canEncryptRequestin interfaceClientEncryptor- Returns:
- true if request data can be encrypted.
-
encryptRequest
Description copied from interface:ClientEncryptorEncrypt data with this encryptor.- Specified by:
encryptRequestin interfaceClientEncryptor- Parameters:
data- Data to encrypt.- Returns:
- Object representing an encrypted request.
- Throws:
EncryptorException- In case of failure.
-
canDecryptResponse
public boolean canDecryptResponse()Description copied from interface:ClientEncryptorDetermine whether encrypted response data can be decrypted. You cannot decrypt the response if you did not encrypt the request before.- Specified by:
canDecryptResponsein interfaceClientEncryptor- Returns:
- true if response data can be decrypted.
-
decryptResponse
Description copied from interface:ClientEncryptorDecrypt response received from the server.- Specified by:
decryptResponsein interfaceClientEncryptor- Parameters:
response- Response data to decrypt.- Returns:
- decrypted bytes.
- Throws:
EncryptorException- In case of failure.
-