try {
byte[] secretKey = dhAlgorithm.generateSecret(dhAgreementModel.get_a(), finalizeDHRequest.getPublicB());
secretKeys.put(finalizeDHRequest.getKeyExchangeSessionId(), secretKey);
keyExchangeSessions.remove(finalizeDHRequest.getKeyExchangeSessionId());
return new DefaultResponse();
} catch (CreatingDHAgreementException e) {
return new ErrorResponse(e.getMessage());
}
}