Class ServerEciesEncryptor
java.lang.Object
io.getlime.security.powerauth.crypto.lib.encryptor.ecies.ServerEciesEncryptor
- All Implemented Interfaces:
ServerEncryptor
Class implements ECIES encryption for PowerAuth Server.
PowerAuth protocol versions:
- 3.0
- 3.1
- 3.2
-
Constructor Summary
ConstructorsConstructorDescriptionServerEciesEncryptor(EncryptorId encryptorId, EncryptorParameters parameters) Construct ECIES encryptor that implements encryption for PowerAuth Server. -
Method Summary
Modifier and TypeMethodDescriptionBuild encryptor secrets that can be used in the external encryptor to decrypt the provided request.booleanDetermine whether encrypted request data can be decrypted.booleanDetermine whether response data can be encrypted.voidconfigureSecrets(EncryptorSecrets secrets) Configure secret keys before the encryptor is used for the encryption and decryption tasks.byte[]decryptRequest(EncryptedRequest request) Decrypt encrypted request data.encryptResponse(byte[] data) Encrypt response data.Get parameters used to construct this encryptor.Get this encryptor's identifier.
-
Constructor Details
-
ServerEciesEncryptor
public ServerEciesEncryptor(EncryptorId encryptorId, EncryptorParameters parameters) throws EncryptorException Construct ECIES encryptor that implements encryption for PowerAuth Server.- Parameters:
encryptorId- Encryptor identifier.parameters- Encryptor parameters.- Throws:
EncryptorException- In case that protocol is not supported.
-
-
Method Details
-
getEncryptorParameters
Description copied from interface:ServerEncryptorGet this encryptor's identifier.- Specified by:
getEncryptorParametersin interfaceServerEncryptor- Returns:
- This encryptor's identifier.
-
getEncryptorId
Description copied from interface:ServerEncryptorGet parameters used to construct this encryptor.- Specified by:
getEncryptorIdin interfaceServerEncryptor- Returns:
- EncryptorParameters used to construct this encryptor.
-
configureSecrets
Description copied from interface:ServerEncryptorConfigure secret keys before the encryptor is used for the encryption and decryption tasks.- Specified by:
configureSecretsin interfaceServerEncryptor- Parameters:
secrets- Object representing a secret keys for particular protocol version.- Throws:
EncryptorException- In case of failure.
-
canDecryptRequest
public boolean canDecryptRequest()Description copied from interface:ServerEncryptorDetermine whether encrypted request data can be decrypted.- Specified by:
canDecryptRequestin interfaceServerEncryptor- Returns:
- true if response data can be decrypted.
-
calculateSecretsForExternalEncryptor
public EncryptorSecrets calculateSecretsForExternalEncryptor(EncryptedRequest request) throws EncryptorException Description copied from interface:ServerEncryptorBuild encryptor secrets that can be used in the external encryptor to decrypt the provided request. The external encryptor is typically running in a different application java environment without knowing the private keys. The best example is cooperation between the PowerAuth Server and our PowerAuth Integration libraries for RESTful API. The server is using this function to calculate the shared secret that can be used in the integration library to actually decrypt the request from the client.- Specified by:
calculateSecretsForExternalEncryptorin interfaceServerEncryptor- Parameters:
request- Request to encrypt in the external server encryptor. The request object should contain all parameters except theencryptedDataandmacproperties.- Returns:
- Object containing encrypted secrets for the external encryptor.
- Throws:
EncryptorException- In case of failure.
-
decryptRequest
Description copied from interface:ServerEncryptorDecrypt encrypted request data.- Specified by:
decryptRequestin interfaceServerEncryptor- Parameters:
request- Object representing an encrypted request.- Returns:
- Decrypted data.
- Throws:
EncryptorException- In case of failure.
-
canEncryptResponse
public boolean canEncryptResponse()Description copied from interface:ServerEncryptorDetermine whether response data can be encrypted. You cannot encrypt the response if you did not decrypt the request before.- Specified by:
canEncryptResponsein interfaceServerEncryptor- Returns:
- true if response data can be decrypted.
-
encryptResponse
Description copied from interface:ServerEncryptorEncrypt response data.- Specified by:
encryptResponsein interfaceServerEncryptor- Parameters:
data- Data to encrypt as response.- Returns:
- Object representing an encrypted response.
- Throws:
EncryptorException- In case of failure.
-