package org.bouncycastle.asn1.x509;
+import java.io.*;
import java.util.Vector;
import java.util.Enumeration;
AlgorithmIdentifier signature;
X509Name issuer;
- DERUTCTime thisUpdate, nextUpdate=null;
+ Time thisUpdate, nextUpdate=null;
X509Extensions extensions=null;
private Vector crlentries=null;
public void setThisUpdate(
DERUTCTime thisUpdate)
{
- this.thisUpdate = thisUpdate;
+ this.thisUpdate = new Time(thisUpdate);
}
public void setNextUpdate(
DERUTCTime nextUpdate)
{
- this.nextUpdate = nextUpdate;
+ this.nextUpdate = new Time(nextUpdate);
+ }
+
+ public void setThisUpdate(
+ Time thisUpdate)
+ {
+ this.thisUpdate = thisUpdate;
}
+ public void setNextUpdate(
+ Time nextUpdate)
+ {
+ this.nextUpdate = nextUpdate;
+ }
public void addCRLEntry(
DERConstructedSequence crlEntry)
public void addCRLEntry(DERInteger userCertificate, DERUTCTime revocationDate, int reason)
{
+ addCRLEntry(userCertificate, new Time(revocationDate), reason);
+ }
+
+ public void addCRLEntry(DERInteger userCertificate, Time revocationDate, int reason)
+ {
DERConstructedSequence seq = new DERConstructedSequence();
seq.addObject(userCertificate);
seq.addObject(revocationDate);
+
if (reason != 0)
{
- ReasonFlags rf = new ReasonFlags(reason);
+ CRLReason rf = new CRLReason(reason);
+ ByteArrayOutputStream bOut = new ByteArrayOutputStream();
+ DEROutputStream dOut = new DEROutputStream(bOut);
+ try
+ {
+ dOut.writeObject(rf);
+ }
+ catch (IOException e)
+ {
+ throw new IllegalArgumentException("error encoding value: " + e);
+ }
+ byte[] value = bOut.toByteArray();
DERConstructedSequence eseq = new DERConstructedSequence();
- eseq.addObject(X509Extensions.ReasonCode);
- eseq.addObject(rf);
+ DERConstructedSequence eseq1 = new DERConstructedSequence();
+ eseq1.addObject(X509Extensions.ReasonCode);
+ eseq1.addObject(new DEROctetString(value));
+ eseq.addObject(eseq1);
X509Extensions ex = new X509Extensions(eseq);
seq.addObject(ex);
}
if (extensions != null)
{
- seq.addObject(new DERTaggedObject(0, extensions.getDERObject()));
+ seq.addObject(new DERTaggedObject(0, extensions));
}
return new TBSCertList(seq);