Interface ServerEncryptor

All Known Implementing Classes:
ServerEciesEncryptor

public interface ServerEncryptor
The ClientEncryptor interface provides End-To-End Encryption for PowerAuth Clients.
  • Method Details

    • getEncryptorParameters

      EncryptorParameters getEncryptorParameters()
      Get this encryptor's identifier.
      Returns:
      This encryptor's identifier.
    • getEncryptorId

      EncryptorId getEncryptorId()
      Get parameters used to construct this encryptor.
      Returns:
      EncryptorParameters used to construct this encryptor.
    • configureSecrets

      void configureSecrets(EncryptorSecrets secrets) throws EncryptorException
      Configure secret keys before the encryptor is used for the encryption and decryption tasks.
      Parameters:
      secrets - Object representing a secret keys for particular protocol version.
      Throws:
      EncryptorException - In case of failure.
    • canDecryptRequest

      boolean canDecryptRequest()
      Determine whether encrypted request data can be decrypted.
      Returns:
      true if response data can be decrypted.
    • calculateSecretsForExternalEncryptor

      EncryptorSecrets calculateSecretsForExternalEncryptor(EncryptedRequest request) throws EncryptorException
      Build 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.
      Parameters:
      request - Request to encrypt in the external server encryptor. The request object should contain all parameters except the encryptedData and mac properties.
      Returns:
      Object containing encrypted secrets for the external encryptor.
      Throws:
      EncryptorException - In case of failure.
    • decryptRequest

      byte[] decryptRequest(EncryptedRequest request) throws EncryptorException
      Decrypt encrypted request data.
      Parameters:
      request - Object representing an encrypted request.
      Returns:
      Decrypted data.
      Throws:
      EncryptorException - In case of failure.
    • canEncryptResponse

      boolean canEncryptResponse()
      Determine whether response data can be encrypted. You cannot encrypt the response if you did not decrypt the request before.
      Returns:
      true if response data can be decrypted.
    • encryptResponse

      EncryptedResponse encryptResponse(byte[] data) throws EncryptorException
      Encrypt response data.
      Parameters:
      data - Data to encrypt as response.
      Returns:
      Object representing an encrypted response.
      Throws:
      EncryptorException - In case of failure.