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

V1TBSCertificateGenerator

public class V1TBSCertificateGenerator extends Object
Generator for Version 1 TBSCertificateStructures.
TBSCertificate ::= SEQUENCE {
version [ 0 ] Version DEFAULT v1(0),
serialNumber CertificateSerialNumber,
signature AlgorithmIdentifier,
issuer Name,
validity Validity,
subject Name,
subjectPublicKeyInfo SubjectPublicKeyInfo,
}

Fields Summary
org.bouncycastle.asn1.DERTaggedObject
version
org.bouncycastle.asn1.DERInteger
serialNumber
AlgorithmIdentifier
signature
X509Name
issuer
Time
startDate
Time
endDate
X509Name
subject
SubjectPublicKeyInfo
subjectPublicKeyInfo
Constructors Summary
public V1TBSCertificateGenerator()


     
    
    
Methods Summary
public TBSCertificateStructuregenerateTBSCertificate()

        if ((serialNumber == null) || (signature == null)
            || (issuer == null) || (startDate == null) || (endDate == null)
            || (subject == null) || (subjectPublicKeyInfo == null))
        {
            throw new IllegalStateException("not all mandatory fields set in V1 TBScertificate generator");
        }

        ASN1EncodableVector  seq = new ASN1EncodableVector();

        // seq.add(version); - not required as default value.
        seq.add(serialNumber);
        seq.add(signature);
        seq.add(issuer);

        //
        // before and after dates
        //
        ASN1EncodableVector  validity = new ASN1EncodableVector();

        validity.add(startDate);
        validity.add(endDate);

        seq.add(new DERSequence(validity));

        seq.add(subject);

        seq.add(subjectPublicKeyInfo);

        return new TBSCertificateStructure(new DERSequence(seq));
    
public voidsetEndDate(Time endDate)

        this.endDate = endDate;
    
public voidsetEndDate(org.bouncycastle.asn1.DERUTCTime endDate)

        this.endDate = new Time(endDate);
    
public voidsetIssuer(X509Name issuer)

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

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

        this.signature = signature;
    
public voidsetStartDate(Time startDate)

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

        this.startDate = new Time(startDate);
    
public voidsetSubject(X509Name subject)

        this.subject = subject;
    
public voidsetSubjectPublicKeyInfo(SubjectPublicKeyInfo pubKeyInfo)

        this.subjectPublicKeyInfo = pubKeyInfo;