Example usage for org.bouncycastle.crypto.agreement.jpake JPAKEParticipant JPAKEParticipant

List of usage examples for org.bouncycastle.crypto.agreement.jpake JPAKEParticipant JPAKEParticipant

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.agreement.jpake JPAKEParticipant JPAKEParticipant.

Prototype

public JPAKEParticipant(String participantId, char[] password, JPAKEPrimeOrderGroup group, Digest digest,
        SecureRandom random) 

Source Link

Document

Construct a new JPAKEParticipant .

Usage

From source file:com.distrimind.util.crypto.P2PJPAKESecretMessageExchanger.java

License:Open Source License

P2PJPAKESecretMessageExchanger(AbstractSecureRandom secureRandom, byte[] participantID, char[] message,
        byte[] salt, int offset_salt, int len_salt)
        throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException {
    super(3, 3);/*  ww  w.j a  va 2  s .  com*/
    if (message == null)
        throw new NullPointerException("message");
    if (salt != null && salt.length - offset_salt < len_salt)
        throw new IllegalArgumentException("salt");

    jpake = new JPAKEParticipant(getParticipanIDString(participantID),
            getHashedPassword(message, salt, offset_salt, len_salt), JPAKEPrimeOrderGroups.NIST_3072,
            new SHA512Digest(), secureRandom);
    this.keyMaterial = null;
}

From source file:com.distrimind.util.crypto.P2PJPAKESecretMessageExchanger.java

License:Open Source License

P2PJPAKESecretMessageExchanger(AbstractSecureRandom secureRandom, byte[] participantID, byte[] message,
        int offset, int len, byte[] salt, int offset_salt, int len_salt, boolean messageIsKey)
        throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException {
    super(3, 3);//  ww w. ja  v  a  2s.c o  m
    if (message == null)
        throw new NullPointerException("message");
    if (message.length - offset < len)
        throw new IllegalArgumentException("message");
    if (salt != null && salt.length - offset_salt < len_salt)
        throw new IllegalArgumentException("salt");

    jpake = new JPAKEParticipant(getParticipanIDString(participantID),
            getHashedPassword(message, offset, len, salt, offset_salt, len_salt, messageIsKey),
            JPAKEPrimeOrderGroups.NIST_3072, new SHA512Digest(), secureRandom);
    this.keyMaterial = null;
}