Java 类org.bouncycastle.crypto.agreement.jpake.JPAKERound3Payload 实例源码

项目:irma_future_id    文件:JPAKEParticipantTest.java   
public void testSuccessfulExchange()
    throws CryptoException
{

    JPAKEParticipant alice = createAlice();
    JPAKEParticipant bob = createBob();

    ExchangeAfterRound2Creation exchange = runExchangeUntilRound2Creation(alice, bob);

    alice.validateRound2PayloadReceived(exchange.bobRound2Payload);
    bob.validateRound2PayloadReceived(exchange.aliceRound2Payload);

    BigInteger aliceKeyingMaterial = alice.calculateKeyingMaterial();
    BigInteger bobKeyingMaterial = bob.calculateKeyingMaterial();

    JPAKERound3Payload aliceRound3Payload = alice.createRound3PayloadToSend(aliceKeyingMaterial);
    JPAKERound3Payload bobRound3Payload = bob.createRound3PayloadToSend(bobKeyingMaterial);

    alice.validateRound3PayloadReceived(bobRound3Payload, aliceKeyingMaterial);
    bob.validateRound3PayloadReceived(aliceRound3Payload, bobKeyingMaterial);

    assertEquals(aliceKeyingMaterial, bobKeyingMaterial);

}
项目:bc-java    文件:JPAKEParticipantTest.java   
public void testSuccessfulExchange()
    throws CryptoException
{

    JPAKEParticipant alice = createAlice();
    JPAKEParticipant bob = createBob();

    ExchangeAfterRound2Creation exchange = runExchangeUntilRound2Creation(alice, bob);

    alice.validateRound2PayloadReceived(exchange.bobRound2Payload);
    bob.validateRound2PayloadReceived(exchange.aliceRound2Payload);

    BigInteger aliceKeyingMaterial = alice.calculateKeyingMaterial();
    BigInteger bobKeyingMaterial = bob.calculateKeyingMaterial();

    JPAKERound3Payload aliceRound3Payload = alice.createRound3PayloadToSend(aliceKeyingMaterial);
    JPAKERound3Payload bobRound3Payload = bob.createRound3PayloadToSend(bobKeyingMaterial);

    alice.validateRound3PayloadReceived(bobRound3Payload, aliceKeyingMaterial);
    bob.validateRound3PayloadReceived(aliceRound3Payload, bobKeyingMaterial);

    assertEquals(aliceKeyingMaterial, bobKeyingMaterial);

}