Example usage for org.bouncycastle.crypto.generators DHBasicKeyPairGenerator init

List of usage examples for org.bouncycastle.crypto.generators DHBasicKeyPairGenerator init

Introduction

In this page you can find the example usage for org.bouncycastle.crypto.generators DHBasicKeyPairGenerator init.

Prototype

public void init(KeyGenerationParameters param) 

Source Link

Usage

From source file:org.openuat.authentication.SimpleKeyAgreement.java

License:Open Source License

/** This is an implementation of init() using the Bouncycastle Lightweight 
 * API. *//*from  w  w w.  j av a 2s  .  c om*/
private void init_BCAPI() {
    // before overwriting the object references, wipe the old values in memory to really destroy them
    wipe();

    org.bouncycastle.crypto.generators.DHBasicKeyPairGenerator kg = new org.bouncycastle.crypto.generators.DHBasicKeyPairGenerator();
    kg.init(new org.bouncycastle.crypto.params.DHKeyGenerationParameters(new SecureRandom(),
            new org.bouncycastle.crypto.params.DHParameters(skip1024Modulus, skip1024Base)));
    myKeypair = kg.generateKeyPair();

    initFromLocalKeyPair_BCAPI();

    state = STATE_INITIALIZED;
}