FileDocCategorySizeDatePackage
AttributeCertificateInfo.javaAPI DocAndroid 1.5 API4754Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509

AttributeCertificateInfo

public class AttributeCertificateInfo extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.DERInteger
version
private Holder
holder
private AttCertIssuer
issuer
private AlgorithmIdentifier
signature
private org.bouncycastle.asn1.DERInteger
serialNumber
private AttCertValidityPeriod
attrCertValidityPeriod
private org.bouncycastle.asn1.ASN1Sequence
attributes
private org.bouncycastle.asn1.DERBitString
issuerUniqueID
private X509Extensions
extensions
Constructors Summary
public AttributeCertificateInfo(org.bouncycastle.asn1.ASN1Sequence seq)

        if (seq.size() < 7 || seq.size() > 9)
        {
            throw new IllegalArgumentException("Bad sequence size: " + seq.size());
        }

        this.version = DERInteger.getInstance(seq.getObjectAt(0));
        this.holder = Holder.getInstance(seq.getObjectAt(1));
        this.issuer = AttCertIssuer.getInstance(seq.getObjectAt(2));
        this.signature = AlgorithmIdentifier.getInstance(seq.getObjectAt(3));
        this.serialNumber = DERInteger.getInstance(seq.getObjectAt(4));
        this.attrCertValidityPeriod = AttCertValidityPeriod.getInstance(seq.getObjectAt(5));
        this.attributes = ASN1Sequence.getInstance(seq.getObjectAt(6));
        
        for (int i = 7; i < seq.size(); i++)
        {
            ASN1Encodable    obj = (ASN1Encodable)seq.getObjectAt(i);

            if (obj instanceof DERBitString)
            {
                this.issuerUniqueID = DERBitString.getInstance(seq.getObjectAt(i));
            }
            else if (obj instanceof ASN1Sequence || obj instanceof X509Extensions)
            {
                this.extensions = X509Extensions.getInstance(seq.getObjectAt(i));
            }
        }
    
Methods Summary
public AttCertValidityPeriodgetAttrCertValidityPeriod()

        return attrCertValidityPeriod;
    
public org.bouncycastle.asn1.ASN1SequencegetAttributes()

        return attributes;
    
public X509ExtensionsgetExtensions()

        return extensions;
    
public HoldergetHolder()

        return holder;
    
public static org.bouncycastle.asn1.x509.AttributeCertificateInfogetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)

        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    
public static org.bouncycastle.asn1.x509.AttributeCertificateInfogetInstance(java.lang.Object obj)

        if (obj instanceof AttributeCertificateInfo)
        {
            return (AttributeCertificateInfo)obj;
        }
        else if (obj instanceof ASN1Sequence)
        {
            return new AttributeCertificateInfo((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public AttCertIssuergetIssuer()

        return issuer;
    
public org.bouncycastle.asn1.DERBitStringgetIssuerUniqueID()

        return issuerUniqueID;
    
public org.bouncycastle.asn1.DERIntegergetSerialNumber()

        return serialNumber;
    
public AlgorithmIdentifiergetSignature()

        return signature;
    
public org.bouncycastle.asn1.DERIntegergetVersion()

        return version;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
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) }

        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);