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

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

Introduction

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

Prototype

public void init(int size, int certainty, SecureRandom random) 

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
 *///from  w w w .  j a v  a2  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;
}