public Response initializeExchange() {
try {
DHAgreementModel dhAgreementModel = dhAlgorithm.generateInitialNumbers();
UUID keyExchangeSessionId = UUID.randomUUID();
keyExchangeSessions.put(keyExchangeSessionId, dhAgreementModel);
return new DHAgreementResponse(dhAgreementModel.getP(), dhAgreementModel.getG(), dhAgreementModel.getPublicA(), keyExchangeSessionId);
} catch (CreatingDHAgreementException e) {
return new ErrorResponse(e.getMessage());
}
}