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

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

Introduction

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

Prototype

public AsymmetricCipherKeyPair generateKeyPair() 

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.  ja  v  a 2  s.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;
}