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.v3.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.v3.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
Constructors Constructor Description AbstractActivationStep(PowerAuthStep step, java.util.List<PowerAuthVersion> supportedVersions, ResultStatusService resultStatusService, StepLoggerFactory stepLoggerFactory)Constructor -
Method Summary
Modifier and Type Method Description protected voidaddEncryptedRequest(StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> stepContext)Prepares ECIES encryptors and encrypts request data.protected org.springframework.core.ParameterizedTypeReference<io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse>getResponseTypeReference()protected abstract io.getlime.security.powerauth.rest.api.model.request.v3.ActivationLayer1RequestprepareLayer1Request(StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> stepContext, io.getlime.security.powerauth.rest.api.model.request.v3.EciesEncryptedRequest encryptedRequestL2)Prepare activation layer 1 request which is decryptable on an intermediate servervoidprocessResponse(StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> stepContext)Processes the response dataResultStatusObjectprocessResponse(io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse encryptedResponseL1, StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> context)Processes response and updates the activation status objectMethods inherited from class io.getlime.security.powerauth.lib.cmd.steps.AbstractBaseStep
addEncryptedRequest, buildStepContext, decryptResponse, execute, execute, 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, java.util.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.v3.EciesEncryptedResponse> stepContext) throws java.lang.ExceptionProcesses the response data- Overrides:
processResponsein classAbstractBaseStep<M extends ActivationData,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse>- Parameters:
stepContext- Step context- Throws:
java.lang.Exception- when an error during response processing occurred
-
processResponse
public ResultStatusObject processResponse(io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse encryptedResponseL1, StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> context) throws java.lang.ExceptionProcesses response and updates the activation status object- Parameters:
encryptedResponseL1- Encrypted response from layer 1context- Sterp context- Returns:
- Activation status object
- Throws:
java.lang.Exception- when an error during response processing occurred
-
prepareLayer1Request
protected abstract io.getlime.security.powerauth.rest.api.model.request.v3.ActivationLayer1Request prepareLayer1Request(StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> stepContext, io.getlime.security.powerauth.rest.api.model.request.v3.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.v3.EciesEncryptedResponse> getResponseTypeReference()- Specified by:
getResponseTypeReferencein classAbstractBaseStep<M extends ActivationData,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse>- Returns:
- Type reference of the response object
-
addEncryptedRequest
protected void addEncryptedRequest(StepContext<M,io.getlime.security.powerauth.rest.api.model.response.v3.EciesEncryptedResponse> stepContext) throws java.lang.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:
java.lang.Exception- when an error during encryption of the request data occurred
-