Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.bouncycastle.asn1.x509;
 
 
public class DSAParameter
    extends ASN1Object
    ASN1Integer      pqg;
    public static DSAParameter getInstance(
        ASN1TaggedObject obj,
        boolean          explicit)
    {
        return getInstance(ASN1Sequence.getInstance(objexplicit));
    }
    public static DSAParameter getInstance(
        Object obj)
    {
        if (obj instanceof DSAParameter)
        {
            return (DSAParameter)obj;
        }
        
        if(obj != null)
        {
            return new DSAParameter(ASN1Sequence.getInstance(obj));
        }
        
        return null;
    }
    public DSAParameter(
        BigInteger  p,
        BigInteger  q,
        BigInteger  g)
    {
        this. = new ASN1Integer(p);
        this. = new ASN1Integer(q);
        this. = new ASN1Integer(g);
    }
    private DSAParameter(
        ASN1Sequence  seq)
    {
        if (seq.size() != 3)
        {
            throw new IllegalArgumentException("Bad sequence size: " + seq.size());
        }
        
        Enumeration     e = seq.getObjects();
         = ASN1Integer.getInstance(e.nextElement());
         = ASN1Integer.getInstance(e.nextElement());
         = ASN1Integer.getInstance(e.nextElement());
    }
    public BigInteger getP()
    {
        return .getPositiveValue();
    }
    public BigInteger getQ()
    {
        return .getPositiveValue();
    }
    public BigInteger getG()
    {
        return .getPositiveValue();
    }
    public ASN1Primitive toASN1Primitive()
    {
        ASN1EncodableVector  v = new ASN1EncodableVector();
        v.add();
        v.add();
        v.add();
        return new DERSequence(v);
    }
New to GrepCode? Check out our FAQ X