FileDocCategorySizeDatePackage
DHParameter.javaAPI DocAndroid 1.5 API1672Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.pkcs

DHParameter

public class DHParameter extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
org.bouncycastle.asn1.DERInteger
p
org.bouncycastle.asn1.DERInteger
g
org.bouncycastle.asn1.DERInteger
l
Constructors Summary
public DHParameter(BigInteger p, BigInteger g, int l)

        this.p = new DERInteger(p);
        this.g = new DERInteger(g);

        if (l != 0)
        {
            this.l = new DERInteger(l);
        }
        else
        {
            this.l = null;
        }
    
public DHParameter(org.bouncycastle.asn1.ASN1Sequence seq)

        Enumeration     e = seq.getObjects();

        p = (DERInteger)e.nextElement();
        g = (DERInteger)e.nextElement();

        if (e.hasMoreElements())
        {
            l = (DERInteger)e.nextElement();
        }
        else
        {
            l = null;
        }
    
Methods Summary
public java.math.BigIntegergetG()

        return g.getPositiveValue();
    
public java.math.BigIntegergetL()

        if (l == null)
        {
            return null;
        }

        return l.getPositiveValue();
    
public java.math.BigIntegergetP()

        return p.getPositiveValue();
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(p);
        v.add(g);

        if (this.getL() != null)
        {
            v.add(l);
        }

        return new DERSequence(v);