Class EncryptorFactory
java.lang.Object
io.getlime.security.powerauth.crypto.lib.encryptor.EncryptorFactory
The
EncryptorFactory class provide high level encryptors for PowerAuth End-To-End encryption implementation.
You can construct both server and client-side constructors in this factory.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetClientEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters) Create client-side encryptor that can encrypt the request and decrypt response from the server.getClientEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters, EncryptorSecrets encryptorSecrets) Create client-side encryptor that can encrypt the request and decrypt the response from the server.getRequestResponseValidator(String protocolVersion) Get request or response data validator for given protocol version.getServerEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters) Create server-side encryptor that can decrypt the request from the client and encrypt the response.getServerEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters, EncryptorSecrets encryptorSecrets) Create server-side encryptor that can decrypt the request from the client and encrypt the response.
-
Constructor Details
-
EncryptorFactory
public EncryptorFactory()
-
-
Method Details
-
getClientEncryptor
public ClientEncryptor getClientEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters) throws EncryptorException Create client-side encryptor that can encrypt the request and decrypt response from the server. To use the encryptor properly, you have to callClientEncryptor.configureSecrets(EncryptorSecrets)function later on the constructed encryptor to make it ready for the cryptographic tasks.- Parameters:
encryptorId- Identifier of encryptor.encryptorParameters- Encryptor parameters.- Returns:
- Client-side encryptor.
- Throws:
EncryptorException- In case that some required parameter is missing or encryptor cannot be constructed.
-
getClientEncryptor
public ClientEncryptor getClientEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters, EncryptorSecrets encryptorSecrets) throws EncryptorException Create client-side encryptor that can encrypt the request and decrypt the response from the server. In this variant of the function, you can provideEncryptorSecretsobject to properly configure the encryptor to make it ready for the cryptographic tasks.- Parameters:
encryptorId- Identifier of encryptor.encryptorParameters- Encryptor parameters.encryptorSecrets- Optional secrets that will be used to configure the encryptor. If null is provided, then you must callClientEncryptor.configureSecrets(EncryptorSecrets)later.- Returns:
- Client-side encryptor.
- Throws:
EncryptorException- In case that some required parameter is missing or encryptor cannot be constructed or configured with the secrets.
-
getServerEncryptor
public ServerEncryptor getServerEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters) throws EncryptorException Create server-side encryptor that can decrypt the request from the client and encrypt the response. To use the encryptor properly, you have to callServerEncryptor.configureSecrets(EncryptorSecrets)function later on the constructed encryptor to make it ready for the cryptographic tasks.- Parameters:
encryptorId- Identifier of encryptor.encryptorParameters- Encryptor parameters.- Returns:
- Server-side encryptor.
- Throws:
EncryptorException- In case that some required parameter is missing or encryptor cannot be constructed.
-
getServerEncryptor
public ServerEncryptor getServerEncryptor(EncryptorId encryptorId, EncryptorParameters encryptorParameters, EncryptorSecrets encryptorSecrets) throws EncryptorException Create server-side encryptor that can decrypt the request from the client and encrypt the response. In this variant of the function, you can provideEncryptorSecretsobject to properly configure the encryptor to make it ready for the cryptographic tasks.- Parameters:
encryptorId- Identifier of encryptor.encryptorParameters- Encryptor parameters.encryptorSecrets- Optional secrets that will be used to configure the encryptor. If null is provided, then you must callServerEncryptor.configureSecrets(EncryptorSecrets)later.- Returns:
- Client-side encryptor.
- Throws:
EncryptorException- In case that some required parameter is missing or encryptor cannot be constructed or configured with the secrets.
-
getRequestResponseValidator
public RequestResponseValidator getRequestResponseValidator(String protocolVersion) throws EncryptorException Get request or response data validator for given protocol version.- Parameters:
protocolVersion- Protocol version.- Returns:
- Object implementing
RequestResponseValidatorinterface. - Throws:
EncryptorException- In case that protocol is unsupported or not specified.
-