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

V2AttributeCertificateInfoGenerator

public class V2AttributeCertificateInfoGenerator extends Object
Generator for Version 2 AttributeCertificateInfo
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
}

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.ASN1EncodableVector
attributes
private org.bouncycastle.asn1.DERBitString
issuerUniqueID
private X509Extensions
extensions
private org.bouncycastle.asn1.DERGeneralizedTime
startDate
private org.bouncycastle.asn1.DERGeneralizedTime
endDate
Constructors Summary
public V2AttributeCertificateInfoGenerator()

        this.version = new DERInteger(1);
        attributes = new ASN1EncodableVector();
    
Methods Summary
public voidaddAttribute(java.lang.String oid, org.bouncycastle.asn1.ASN1Encodable value)

        attributes.add(new Attribute(new DERObjectIdentifier(oid), new DERSet(value)));
    
public voidaddAttribute(Attribute attribute)

param
attribute

        attributes.add(attribute);
    
public AttributeCertificateInfogenerateAttributeCertificateInfo()

        if ((serialNumber == null) || (signature == null)
            || (issuer == null) || (startDate == null) || (endDate == null)
            || (holder == null) || (attributes == null))
        {
            throw new IllegalStateException("not all mandatory fields set in V2 AttributeCertificateInfo generator");
        }

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(version);
        v.add(holder);
        v.add(issuer);
        v.add(signature);
        v.add(serialNumber);
    
        //
        // before and after dates => AttCertValidityPeriod
        //
        AttCertValidityPeriod validity = new AttCertValidityPeriod(startDate, endDate);
        v.add(validity);
        
        // Attributes
        v.add(new DERSequence(attributes));
        
        if (issuerUniqueID != null)
        {
            v.add(issuerUniqueID);
        }
    
        if (extensions != null)
        {
            v.add(extensions);
        }

        return new AttributeCertificateInfo(new DERSequence(v));
    
public voidsetEndDate(org.bouncycastle.asn1.DERGeneralizedTime endDate)

        this.endDate = endDate;
    
public voidsetExtensions(X509Extensions extensions)

        this.extensions = extensions;
    
public voidsetHolder(Holder holder)

        this.holder = holder;
    
public voidsetIssuer(AttCertIssuer issuer)

        this.issuer = issuer;
    
public voidsetIssuerUniqueID(org.bouncycastle.asn1.DERBitString issuerUniqueID)

        this.issuerUniqueID = issuerUniqueID;
    
public voidsetSerialNumber(org.bouncycastle.asn1.DERInteger serialNumber)

        this.serialNumber = serialNumber;
    
public voidsetSignature(AlgorithmIdentifier signature)

        this.signature = signature;
    
public voidsetStartDate(org.bouncycastle.asn1.DERGeneralizedTime startDate)

        this.startDate = startDate;