Package com.frontend.models.response.DiffieHellman

Examples of com.frontend.models.response.DiffieHellman.DHAgreementResponse


                .andExpect(content().contentType("application/json;charset=UTF-8"));
    }

    @Test
    public void shouldReceiveDHAgreement() throws Exception {
        DHAgreementResponse dhAgreementResponse = initializeDHAgreement();
    }
View Full Code Here


        return objectMapper.readValue(mvcResult.getResponse().getContentAsString(), DHAgreementResponse.class);
    }

    @Test
    public void shouldFinalizeDHAgreement() throws Exception {
        DHAgreementResponse serverDHResponse = initializeDHAgreement();

        DHAgreementModel localDHAgreementModel = dhAlgorithm.generateInitialNumbers(serverDHResponse.getP(), serverDHResponse.getG());
        FinalizeDHRequest finalizeDHRequest = new FinalizeDHRequest(serverDHResponse.getKeyExchangeSessionId(), localDHAgreementModel.getPublicA());

        DefaultResponse defaultResponse = finalizeDHAgreement(finalizeDHRequest);
    }
View Full Code Here

    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());
        }
    }
View Full Code Here

TOP

Related Classes of com.frontend.models.response.DiffieHellman.DHAgreementResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.