Class PowerAuthEncryptionProviderBase
java.lang.Object
io.getlime.security.powerauth.rest.api.spring.provider.PowerAuthEncryptionProviderBase
- Direct Known Subclasses:
PowerAuthEncryptionProvider
public abstract class PowerAuthEncryptionProviderBase extends Object
Abstract class for PowerAuth encryption provider with common HTTP header parsing logic. The class is available for
protocol version 3.0 and newer.
- Author:
- Roman Strobl, roman.strobl@wultra.com
-
Constructor Summary
Constructors Constructor Description PowerAuthEncryptionProviderBase() -
Method Summary
Modifier and Type Method Description PowerAuthEciesEncryptiondecryptRequest(javax.servlet.http.HttpServletRequest request, Type requestType, io.getlime.security.powerauth.crypto.lib.encryptor.ecies.model.EciesScope eciesScope)Decrypt HTTP request body and construct object with ECIES data.EciesEncryptedResponseencryptResponse(Object responseObject, PowerAuthEciesEncryption eciesEncryption)Encrypt response using ECIES.abstract PowerAuthEciesDecryptorParametersgetEciesDecryptorParameters(String activationId, String applicationKey, String ephemeralPublicKey)Get ECIES decryptor parameters from PowerAuth server.
-
Constructor Details
-
PowerAuthEncryptionProviderBase
public PowerAuthEncryptionProviderBase()
-
-
Method Details
-
getEciesDecryptorParameters
@Nonnull public abstract PowerAuthEciesDecryptorParameters getEciesDecryptorParameters(@Nullable String activationId, @Nonnull String applicationKey, @Nonnull String ephemeralPublicKey) throws PowerAuthEncryptionExceptionGet 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
@Nonnull public PowerAuthEciesEncryption decryptRequest(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull Type requestType, @Nonnull io.getlime.security.powerauth.crypto.lib.encryptor.ecies.model.EciesScope eciesScope) throws PowerAuthEncryptionExceptionDecrypt HTTP request body and construct object with ECIES data. Use the requestType parameter to specify the type of decrypted object.- 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
@Nullable public EciesEncryptedResponse encryptResponse(@Nonnull Object responseObject, @Nonnull PowerAuthEciesEncryption eciesEncryption)Encrypt response using ECIES.- Parameters:
responseObject- Response object which should be encrypted.eciesEncryption- PowerAuth encryption object.- Returns:
- ECIES encrypted response.
-