Search in sources :

Example 21 with DERSequence

use of org.bouncycastle.asn1.DERSequence in project robovm by robovm.

the class DHDomainParameters method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(this.p);
    v.add(this.g);
    v.add(this.q);
    if (this.j != null) {
        v.add(this.j);
    }
    if (this.validationParms != null) {
        v.add(this.validationParms);
    }
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 22 with DERSequence

use of org.bouncycastle.asn1.DERSequence in project robovm by robovm.

the class X9Curve method toASN1Primitive.

/**
     * Produce an object suitable for an ASN1OutputStream.
     * <pre>
     *  Curve ::= SEQUENCE {
     *      a               FieldElement,
     *      b               FieldElement,
     *      seed            BIT STRING      OPTIONAL
     *  }
     * </pre>
     */
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    if (fieldIdentifier.equals(prime_field)) {
        v.add(new X9FieldElement(curve.getA()).toASN1Primitive());
        v.add(new X9FieldElement(curve.getB()).toASN1Primitive());
    } else if (fieldIdentifier.equals(characteristic_two_field)) {
        v.add(new X9FieldElement(curve.getA()).toASN1Primitive());
        v.add(new X9FieldElement(curve.getB()).toASN1Primitive());
    }
    if (seed != null) {
        v.add(new DERBitString(seed));
    }
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector) DERBitString(org.bouncycastle.asn1.DERBitString)

Example 23 with DERSequence

use of org.bouncycastle.asn1.DERSequence in project robovm by robovm.

the class X9FieldID method toASN1Primitive.

/**
     * Produce a DER encoding of the following structure.
     * <pre>
     *  FieldID ::= SEQUENCE {
     *      fieldType       FIELD-ID.&amp;id({IOSet}),
     *      parameters      FIELD-ID.&amp;Type({IOSet}{&#64;fieldType})
     *  }
     * </pre>
     */
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(this.id);
    v.add(this.parameters);
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 24 with DERSequence

use of org.bouncycastle.asn1.DERSequence in project robovm by robovm.

the class CertificateList method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(tbsCertList);
    v.add(sigAlgId);
    v.add(sig);
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Example 25 with DERSequence

use of org.bouncycastle.asn1.DERSequence in project robovm by robovm.

the class DigestInfo method toASN1Primitive.

public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(algId);
    v.add(new DEROctetString(digest));
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector) DEROctetString(org.bouncycastle.asn1.DEROctetString)

Aggregations

DERSequence (org.bouncycastle.asn1.DERSequence)118 ASN1EncodableVector (org.bouncycastle.asn1.ASN1EncodableVector)111 DERTaggedObject (org.bouncycastle.asn1.DERTaggedObject)17 DERBitString (org.bouncycastle.asn1.DERBitString)13 DEROctetString (org.bouncycastle.asn1.DEROctetString)13 IOException (java.io.IOException)12 X509Certificate (java.security.cert.X509Certificate)11 Enumeration (java.util.Enumeration)10 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)9 DERInteger (org.bouncycastle.asn1.DERInteger)9 GeneralName (org.bouncycastle.asn1.x509.GeneralName)9 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)8 BigInteger (java.math.BigInteger)7 List (java.util.List)7 DERIA5String (org.bouncycastle.asn1.DERIA5String)7 PrivateKey (java.security.PrivateKey)6 DERObjectIdentifier (org.bouncycastle.asn1.DERObjectIdentifier)6 ASN1EncodableVector (com.android.org.bouncycastle.asn1.ASN1EncodableVector)5 ASN1InputStream (com.android.org.bouncycastle.asn1.ASN1InputStream)5 ASN1Integer (com.android.org.bouncycastle.asn1.ASN1Integer)5