addCRLEntry(userCertificate, revocationDate, reason, null);
}
public void addCRLEntry(DERInteger userCertificate, Time revocationDate, int reason, DERGeneralizedTime invalidityDate)
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(userCertificate);
v.add(revocationDate);
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.getMessage(), 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.getMessage(), e);
}
}
if (extOids.size() != 0)
{
X509Extensions ex = new X509Extensions(extOids, extValues);
v.add(ex);
}
if (crlentries == null)
{
crlentries = new Vector();