Class PowerAuthEncryptionProviderBase


  • public abstract class PowerAuthEncryptionProviderBase
    extends java.lang.Object
    Abstract class for PowerAuth encryption provider with common HTTP header parsing logic.
    Author:
    Roman Strobl, roman.strobl@wultra.com
    • Constructor Detail

      • PowerAuthEncryptionProviderBase

        public PowerAuthEncryptionProviderBase()
    • Method Detail

      • getEciesDecryptorParameters

        public abstract PowerAuthEciesDecryptorParameters getEciesDecryptorParameters​(java.lang.String activationId,
                                                                                      java.lang.String applicationKey,
                                                                                      java.lang.String ephemeralPublicKey)
                                                                               throws PowerAuthEncryptionException
        Get ECIES decryptor parameters from PowerAuth server.
        Parameters:
        activationId - Activation ID (only used in activation scope, in application scope use null).
        applicationKey - Application key.
        ephemeralPublicKey - Ephemeral public key for ECIES.
        Returns:
        ECIES decryptor parameters.
        Throws:
        PowerAuthEncryptionException - In case PowerAuth server call fails.
      • decryptRequest

        public <T> PowerAuthEciesEncryption<T> decryptRequest​(javax.servlet.http.HttpServletRequest request,
                                                              java.lang.Class<T> requestType,
                                                              io.getlime.security.powerauth.crypto.lib.encryptor.ecies.model.EciesScope eciesScope)
                                                       throws PowerAuthEncryptionException
        Decrypt HTTP request body and construct object with ECIES data. Use the requestType parameter to specify the type of decrypted object.
        Type Parameters:
        T - Generic request object type.
        Parameters:
        request - HTTP request.
        requestType - Class of request object.
        eciesScope - ECIES scope.
        Returns:
        Object with ECIES data.
        Throws:
        PowerAuthEncryptionException - In case request decryption fails.
      • encryptResponse

        public io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse encryptResponse​(java.lang.Object responseObject,
                                                                                                               PowerAuthEciesEncryption eciesEncryption)
        Encrypt response using ECIES.
        Parameters:
        responseObject - Response object which should be encrypted.
        eciesEncryption - PowerAuth encryption object.
        Returns:
        ECIES encrypted response.