Search in sources :

Example 6 with AttributeCertificateInfo

use of org.bouncycastle.asn1.x509.AttributeCertificateInfo in project robovm by robovm.

the class AttributeCertificateInfo method toASN1Primitive.

/**
     * Produce an object suitable for an ASN1OutputStream.
     * <pre>
     *  AttributeCertificateInfo ::= SEQUENCE {
     *       version              AttCertVersion -- version is v2,
     *       holder               Holder,
     *       issuer               AttCertIssuer,
     *       signature            AlgorithmIdentifier,
     *       serialNumber         CertificateSerialNumber,
     *       attrCertValidityPeriod   AttCertValidityPeriod,
     *       attributes           SEQUENCE OF Attribute,
     *       issuerUniqueID       UniqueIdentifier OPTIONAL,
     *       extensions           Extensions OPTIONAL
     *  }
     *
     *  AttCertVersion ::= INTEGER { v2(1) }
     * </pre>
     */
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector v = new ASN1EncodableVector();
    v.add(version);
    v.add(holder);
    v.add(issuer);
    v.add(signature);
    v.add(serialNumber);
    v.add(attrCertValidityPeriod);
    v.add(attributes);
    if (issuerUniqueID != null) {
        v.add(issuerUniqueID);
    }
    if (extensions != null) {
        v.add(extensions);
    }
    return new DERSequence(v);
}
Also used : DERSequence(org.bouncycastle.asn1.DERSequence) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector)

Aggregations

ASN1EncodableVector (org.bouncycastle.asn1.ASN1EncodableVector)5 DERSequence (org.bouncycastle.asn1.DERSequence)5 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 DERBitString (org.bouncycastle.asn1.DERBitString)1 DEROutputStream (org.bouncycastle.asn1.DEROutputStream)1 AttributeCertificateInfo (org.bouncycastle.asn1.x509.AttributeCertificateInfo)1 ContentVerifier (org.bouncycastle.operator.ContentVerifier)1