use of io.getlime.powerauth.soap.PrepareActivationResponse in project powerauth-restful-integration by lime-company.
the class ActivationController method createActivation.
/**
* Create a new activation.
* @param request PowerAuth RESTful request with {@link ActivationCreateRequest} payload.
* @return PowerAuth RESTful response with {@link ActivationCreateResponse} payload.
*/
@RequestMapping(value = "create", method = RequestMethod.POST)
@ResponseBody
public ObjectResponse<ActivationCreateResponse> createActivation(@RequestBody ObjectRequest<ActivationCreateRequest> request) throws PowerAuthActivationException {
try {
String activationIDShort = request.getRequestObject().getActivationIdShort();
String activationNonce = request.getRequestObject().getActivationNonce();
String cDevicePublicKey = request.getRequestObject().getEncryptedDevicePublicKey();
String activationName = request.getRequestObject().getActivationName();
String extras = request.getRequestObject().getExtras();
String applicationKey = request.getRequestObject().getApplicationKey();
String applicationSignature = request.getRequestObject().getApplicationSignature();
String clientEphemeralKey = request.getRequestObject().getEphemeralPublicKey();
PrepareActivationResponse soapResponse = powerAuthClient.prepareActivation(activationIDShort, activationName, activationNonce, clientEphemeralKey, cDevicePublicKey, extras, applicationKey, applicationSignature);
ActivationCreateResponse response = new ActivationCreateResponse();
response.setActivationId(soapResponse.getActivationId());
response.setActivationNonce(soapResponse.getActivationNonce());
response.setEncryptedServerPublicKey(soapResponse.getEncryptedServerPublicKey());
response.setEncryptedServerPublicKeySignature(soapResponse.getEncryptedServerPublicKeySignature());
response.setEphemeralPublicKey(soapResponse.getEphemeralPublicKey());
return new ObjectResponse<>(response);
} catch (Exception ex) {
throw new PowerAuthActivationException();
}
}
Aggregations