Example usage for org.bouncycastle.asn1.oiw ElGamalParameter getG

List of usage examples for org.bouncycastle.asn1.oiw ElGamalParameter getG

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.oiw ElGamalParameter getG.

Prototype

public BigInteger getG() 

Source Link

Usage

From source file:ElGamalPrivatePGKey.java

License:Open Source License

public ElGamalPrivatePGKey(PrivateKeyInfo info) {
    ElGamalParameter params = new ElGamalParameter((ASN1Sequence) info.getAlgorithmId().getParameters());
    DERInteger derX = (DERInteger) info.getPrivateKey();

    this.x = derX.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}

From source file:ElGamalPublicPGKey.java

License:Open Source License

public ElGamalPublicPGKey(SubjectPublicKeyInfo info) {
    ElGamalParameter params = new ElGamalParameter((ASN1Sequence) info.getAlgorithmId().getParameters());
    DERInteger derY = null;/*from  ww w.j av  a 2 s . com*/

    try {
        derY = (DERInteger) info.getPublicKey();
    } catch (IOException e) {
        throw new IllegalArgumentException("invalid info structure in DSA public key");
    }

    this.y = derY.getValue();
    this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}