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

TBSCertList

public class TBSCertList extends org.bouncycastle.asn1.ASN1Encodable
PKIX RFC-2459 - TBSCertList object.
TBSCertList ::= SEQUENCE {
version Version OPTIONAL,
-- if present, shall be v2
signature AlgorithmIdentifier,
issuer Name,
thisUpdate Time,
nextUpdate Time OPTIONAL,
revokedCertificates SEQUENCE OF SEQUENCE {
userCertificate CertificateSerialNumber,
revocationDate Time,
crlEntryExtensions Extensions OPTIONAL
-- if present, shall be v2
} OPTIONAL,
crlExtensions [0] EXPLICIT Extensions OPTIONAL
-- if present, shall be v2
}

Fields Summary
org.bouncycastle.asn1.ASN1Sequence
seq
org.bouncycastle.asn1.DERInteger
version
AlgorithmIdentifier
signature
X509Name
issuer
Time
thisUpdate
Time
nextUpdate
CRLEntry[]
revokedCertificates
X509Extensions
crlExtensions
Constructors Summary
public TBSCertList(org.bouncycastle.asn1.ASN1Sequence seq)

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

        int seqPos = 0;

        this.seq = seq;

        if (seq.getObjectAt(seqPos) instanceof DERInteger)
        {
            version = DERInteger.getInstance(seq.getObjectAt(seqPos++));
        }
        else
        {
            version = new DERInteger(0);
        }

        signature = AlgorithmIdentifier.getInstance(seq.getObjectAt(seqPos++));
        issuer = X509Name.getInstance(seq.getObjectAt(seqPos++));
        thisUpdate = Time.getInstance(seq.getObjectAt(seqPos++));

        if (seqPos < seq.size()
            && (seq.getObjectAt(seqPos) instanceof DERUTCTime
               || seq.getObjectAt(seqPos) instanceof DERGeneralizedTime
               || seq.getObjectAt(seqPos) instanceof Time))
        {
            nextUpdate = Time.getInstance(seq.getObjectAt(seqPos++));
        }

        if (seqPos < seq.size()
            && !(seq.getObjectAt(seqPos) instanceof DERTaggedObject))
        {
            ASN1Sequence certs = ASN1Sequence.getInstance(seq.getObjectAt(seqPos++));
            revokedCertificates = new CRLEntry[certs.size()];

            for (int i = 0; i < revokedCertificates.length; i++)
            {
                revokedCertificates[i] = new CRLEntry(ASN1Sequence.getInstance(certs.getObjectAt(i)));
            }
        }

        if (seqPos < seq.size()
            && seq.getObjectAt(seqPos) instanceof DERTaggedObject)
        {
            crlExtensions = X509Extensions.getInstance(seq.getObjectAt(seqPos++));
        }
    
Methods Summary
public X509ExtensionsgetExtensions()

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

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

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

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

        return issuer;
    
public TimegetNextUpdate()

        return nextUpdate;
    
public org.bouncycastle.asn1.x509.TBSCertList$CRLEntry[]getRevokedCertificates()

        return revokedCertificates;
    
public AlgorithmIdentifiergetSignature()

        return signature;
    
public TimegetThisUpdate()

        return thisUpdate;
    
public intgetVersion()

        return version.getValue().intValue() + 1;
    
public org.bouncycastle.asn1.DERIntegergetVersionNumber()

        return version;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        return seq;