V2TBSCertListGeneratorpublic class V2TBSCertListGenerator extends Object Generator for Version 2 TBSCertList structures.
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
}
Note: This class may be subject to change |
Fields Summary |
---|
org.bouncycastle.asn1.DERInteger | version | AlgorithmIdentifier | signature | X509Name | issuer | Time | thisUpdate | Time | nextUpdate | X509Extensions | extensions | private Vector | crlentries |
Constructors Summary |
---|
public V2TBSCertListGenerator()
|
Methods Summary |
---|
public void | addCRLEntry(org.bouncycastle.asn1.DERInteger userCertificate, Time revocationDate, int reason)
addCRLEntry(userCertificate, revocationDate, reason, null);
| public void | addCRLEntry(org.bouncycastle.asn1.DERInteger userCertificate, Time revocationDate, int reason, org.bouncycastle.asn1.DERGeneralizedTime invalidityDate)
Vector extOids = new Vector();
Vector extValues = new Vector();
if (reason != 0)
{
CRLReason crlReason = new CRLReason(reason);
try
{
extOids.addElement(X509Extensions.ReasonCode);
extValues.addElement(new X509Extension(false, new DEROctetString(crlReason.getEncoded())));
}
catch (IOException e)
{
throw new IllegalArgumentException("error encoding reason: " + e);
}
}
if (invalidityDate != null)
{
try
{
extOids.addElement(X509Extensions.InvalidityDate);
extValues.addElement(new X509Extension(false, new DEROctetString(invalidityDate.getEncoded())));
}
catch (IOException e)
{
throw new IllegalArgumentException("error encoding invalidityDate: " + e);
}
}
if (extOids.size() != 0)
{
addCRLEntry(userCertificate, revocationDate, new X509Extensions(extOids, extValues));
}
else
{
addCRLEntry(userCertificate, revocationDate, null);
}
| public void | addCRLEntry(org.bouncycastle.asn1.DERInteger userCertificate, Time revocationDate, X509Extensions extensions)
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(userCertificate);
v.add(revocationDate);
if (extensions != null)
{
v.add(extensions);
}
addCRLEntry(new DERSequence(v));
| public void | addCRLEntry(org.bouncycastle.asn1.ASN1Sequence crlEntry)
if (crlentries == null)
{
crlentries = new Vector();
}
crlentries.addElement(crlEntry);
| public void | addCRLEntry(org.bouncycastle.asn1.DERInteger userCertificate, org.bouncycastle.asn1.DERUTCTime revocationDate, int reason)
addCRLEntry(userCertificate, new Time(revocationDate), reason);
| public TBSCertList | generateTBSCertList()
if ((signature == null) || (issuer == null) || (thisUpdate == null))
{
throw new IllegalStateException("Not all mandatory fields set in V2 TBSCertList generator.");
}
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(signature);
v.add(issuer);
v.add(thisUpdate);
if (nextUpdate != null)
{
v.add(nextUpdate);
}
// Add CRLEntries if they exist
if (crlentries != null)
{
ASN1EncodableVector certs = new ASN1EncodableVector();
Enumeration it = crlentries.elements();
while(it.hasMoreElements())
{
certs.add((ASN1Sequence)it.nextElement());
}
v.add(new DERSequence(certs));
}
if (extensions != null)
{
v.add(new DERTaggedObject(0, extensions));
}
return new TBSCertList(new DERSequence(v));
| public void | setExtensions(X509Extensions extensions)
this.extensions = extensions;
| public void | setIssuer(X509Name issuer)
this.issuer = issuer;
| public void | setNextUpdate(org.bouncycastle.asn1.DERUTCTime nextUpdate)
this.nextUpdate = new Time(nextUpdate);
| public void | setNextUpdate(Time nextUpdate)
this.nextUpdate = nextUpdate;
| public void | setSignature(AlgorithmIdentifier signature)
this.signature = signature;
| public void | setThisUpdate(org.bouncycastle.asn1.DERUTCTime thisUpdate)
this.thisUpdate = new Time(thisUpdate);
| public void | setThisUpdate(Time thisUpdate)
this.thisUpdate = thisUpdate;
|
|