Example usage for org.bouncycastle.crypto.generators ElGamalParametersGenerator ElGamalParametersGenerator

List of usage examples for org.bouncycastle.crypto.generators ElGamalParametersGenerator ElGamalParametersGenerator

Introduction

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

Prototype

ElGamalParametersGenerator

Source Link

Usage

From source file:util.secure.AsymKeysImpl.java

License:Open Source License

/**
 * This method is used to generate P and G
 * @return ElGamalParameters for GenerateKeys
 *///w  w  w. ja v  a 2  s  .  co m
private ElGamalParameters GeneratePG() {
    ElGamalParameters params;
    ElGamalParametersGenerator apg;
    apg = new ElGamalParametersGenerator();
    apg.init(1024, 20, random);

    params = apg.generateParameters();
    p = params.getP();
    g = params.getG();
    return params;
}