Class AbstractActivationStep<M extends ActivationData>
java.lang.Object
io.getlime.security.powerauth.lib.cmd.steps.AbstractBaseStep<M,io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse>
io.getlime.security.powerauth.lib.cmd.steps.AbstractActivationStep<M>
- All Implemented Interfaces:
BaseStep
- Direct Known Subclasses:
ActivationRecoveryStep,CreateActivationStep,PrepareActivationStep
public abstract class AbstractActivationStep<M extends ActivationData>
extends AbstractBaseStep<M,io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse>
Abstract step with common parts used in activations steps
- Author:
- Lukas Lukovsky, lukas.lukovsky@wultra.com
-
Field Summary
Fields inherited from class io.getlime.security.powerauth.lib.cmd.steps.AbstractBaseStep
resultStatusService, stepLoggerFactory -
Constructor Summary
ConstructorsConstructorDescriptionAbstractActivationStep(PowerAuthStep step, List<PowerAuthVersion> supportedVersions, ResultStatusService resultStatusService, StepLoggerFactory stepLoggerFactory) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddEncryptedRequest(StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext) Prepares ECIES encryptors and encrypts request data.protected org.springframework.core.ParameterizedTypeReference<io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> protected abstract io.getlime.security.powerauth.rest.api.model.request.ActivationLayer1RequestprepareLayer1Request(StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext, io.getlime.security.powerauth.rest.api.model.request.EciesEncryptedRequest encryptedRequestL2) Prepare activation layer 1 request which is decryptable on an intermediate servervoidprocessResponse(StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext) Processes the response dataprocessResponse(io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse encryptedResponseL1, StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> context) Processes response and updates the activation status objectMethods inherited from class io.getlime.security.powerauth.lib.cmd.steps.AbstractBaseStep
addEncryptedRequest, addEncryptedRequest, buildStepContext, decryptResponse, execute, fetchTemporaryKey, incrementCounter, logDryRun, prepareStepContext, processResponseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.getlime.security.powerauth.lib.cmd.steps.BaseStep
getStep, getSupportedVersions
-
Constructor Details
-
AbstractActivationStep
public AbstractActivationStep(PowerAuthStep step, List<PowerAuthVersion> supportedVersions, ResultStatusService resultStatusService, StepLoggerFactory stepLoggerFactory) Constructor- Parameters:
step- Corresponding PowerAuth stepsupportedVersions- Supported versions of PowerAuthresultStatusService- Result status servicestepLoggerFactory- Step logger factory
-
-
Method Details
-
processResponse
public void processResponse(StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext) throws ExceptionProcesses the response data- Overrides:
processResponsein classAbstractBaseStep<M extends ActivationData,io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> - Parameters:
stepContext- Step context- Throws:
Exception- when an error during response processing occurred
-
processResponse
public ResultStatusObject processResponse(io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse encryptedResponseL1, StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> context) throws ExceptionProcesses response and updates the activation status object- Parameters:
encryptedResponseL1- Encrypted response from layer 1context- Sterp context- Returns:
- Activation status object
- Throws:
Exception- when an error during response processing occurred
-
prepareLayer1Request
protected abstract io.getlime.security.powerauth.rest.api.model.request.ActivationLayer1Request prepareLayer1Request(StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext, io.getlime.security.powerauth.rest.api.model.request.EciesEncryptedRequest encryptedRequestL2) Prepare activation layer 1 request which is decryptable on an intermediate server- Parameters:
stepContext- Step contextencryptedRequestL2- Encrypted request from layer 2- Returns:
- Layer 1 request
-
getResponseTypeReference
protected org.springframework.core.ParameterizedTypeReference<io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> getResponseTypeReference()- Specified by:
getResponseTypeReferencein classAbstractBaseStep<M extends ActivationData,io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> - Returns:
- Type reference of the response object
-
addEncryptedRequest
protected void addEncryptedRequest(StepContext<M, io.getlime.security.powerauth.rest.api.model.response.EciesEncryptedResponse> stepContext) throws ExceptionPrepares ECIES encryptors and encrypts request data. The encrypted request is then added to the request context of this step.- Parameters:
stepContext- Step context- Throws:
Exception- when an error during encryption of the request data occurred
-