FileDocCategorySizeDatePackage
TBSCertificateStructure.javaAPI DocAzureus 3.0.3.45197Tue Jun 08 05:12:56 BST 2004org.bouncycastle.asn1.x509

TBSCertificateStructure

public class TBSCertificateStructure extends Object implements X509ObjectIdentifiers, org.bouncycastle.asn1.DEREncodable, org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers
The TBSCertificate object.
TBSCertificate ::= SEQUENCE {
version [ 0 ] Version DEFAULT v1(0),
serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier,
issuer Name,
validity Validity,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
issuerUniqueID [ 1 ] IMPLICIT UniqueIdentifier OPTIONAL,
subjectUniqueID [ 2 ] IMPLICIT UniqueIdentifier OPTIONAL,
extensions [ 3 ] Extensions OPTIONAL
}

Note: issuerUniqueID and subjectUniqueID are both deprecated by the IETF. This class will parse them, but you really shouldn't be creating new ones.

Fields Summary
org.bouncycastle.asn1.ASN1Sequence
seq
org.bouncycastle.asn1.DERInteger
version
org.bouncycastle.asn1.DERInteger
serialNumber
AlgorithmIdentifier
signature
X509Name
issuer
Time
startDate
Time
endDate
X509Name
subject
SubjectPublicKeyInfo
subjectPublicKeyInfo
org.bouncycastle.asn1.DERBitString
issuerUniqueId
org.bouncycastle.asn1.DERBitString
subjectUniqueId
X509Extensions
extensions
Constructors Summary
public TBSCertificateStructure(org.bouncycastle.asn1.ASN1Sequence seq)

        int         seqStart = 0;

        this.seq = seq;

        //
        // some certficates don't include a version number - we assume v1
        //
        if (seq.getObjectAt(0) instanceof DERTaggedObject)
        {
            version = DERInteger.getInstance(seq.getObjectAt(0));
        }
        else
        {
            seqStart = -1;          // field 0 is missing!
            version = new DERInteger(0);
        }

        serialNumber = DERInteger.getInstance(seq.getObjectAt(seqStart + 1));

        signature = AlgorithmIdentifier.getInstance(seq.getObjectAt(seqStart + 2));
        issuer = X509Name.getInstance(seq.getObjectAt(seqStart + 3));

        //
        // before and after dates
        //
        ASN1Sequence  dates = (ASN1Sequence)seq.getObjectAt(seqStart + 4);

        startDate = Time.getInstance(dates.getObjectAt(0));
        endDate = Time.getInstance(dates.getObjectAt(1));

        subject = X509Name.getInstance(seq.getObjectAt(seqStart + 5));

        //
        // public key info.
        //
        subjectPublicKeyInfo = SubjectPublicKeyInfo.getInstance(seq.getObjectAt(seqStart + 6));

        for (int extras = seq.size() - (seqStart + 6) - 1; extras > 0; extras--)
        {
            DERTaggedObject extra = (DERTaggedObject)seq.getObjectAt(seqStart + 6 + extras);

            switch (extra.getTagNo())
            {
            case 1:
                issuerUniqueId = DERBitString.getInstance(extra);
                break;
            case 2:
                subjectUniqueId = DERBitString.getInstance(extra);
                break;
            case 3:
                extensions = X509Extensions.getInstance(extra);
            }
        }
    
Methods Summary
public org.bouncycastle.asn1.DERObjectgetDERObject()

        return seq;
    
public TimegetEndDate()

        return endDate;
    
public X509ExtensionsgetExtensions()

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

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

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

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

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

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

        return serialNumber;
    
public AlgorithmIdentifiergetSignature()

        return signature;
    
public TimegetStartDate()

        return startDate;
    
public X509NamegetSubject()

        return subject;
    
public SubjectPublicKeyInfogetSubjectPublicKeyInfo()

        return subjectPublicKeyInfo;
    
public org.bouncycastle.asn1.DERBitStringgetSubjectUniqueId()

        return subjectUniqueId;
    
public intgetVersion()

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

        return version;