Class EncryptorFactory

java.lang.Object
io.getlime.security.powerauth.crypto.lib.encryptor.EncryptorFactory

public class EncryptorFactory extends Object
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 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 call ClientEncryptor.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 provide EncryptorSecrets object 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 call ClientEncryptor.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 call ServerEncryptor.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 provide EncryptorSecrets object 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 call ServerEncryptor.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 RequestResponseValidator interface.
      Throws:
      EncryptorException - In case that protocol is unsupported or not specified.