public void setEndDate( ASN1UTCTime endDate) { this.endDate = new Time(endDate); }
public String toString() { return getTime(); } }
/** * Return whether or not this certificate is valid on a particular date. * * @param date the date of interest. * @return true if the certificate is valid, false otherwise. */ public boolean isValidOn(Date date) { return !date.before(x509Certificate.getStartDate().getDate()) && !date.after(x509Certificate.getEndDate().getDate()); }
public static Time getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(obj.getObject()); // must be explicitly tagged }
private static ASN1Sequence createInvalidityDateExtension(Time invalidityDate) { ASN1EncodableVector v = new ASN1EncodableVector(); try { v.add(X509Extension.invalidityDate); v.add(new DEROctetString(invalidityDate.getEncoded())); } catch (IOException e) { throw new IllegalArgumentException("error encoding reason: " + e); } return new DERSequence(v); } }
/** * Return the date after which this certificate is not valid. * * @return the final time for the certificate's validity period. */ public Date getNotAfter() { return x509Certificate.getEndDate().getDate(); }
public Time getRevocationDate() { return Time.getInstance(seq.getObjectAt(1)); }
private Time createTime(Date date) { if (date != null) { return new Time(date); } return null; }
/** * Return the date before which this certificate is not valid. * * @return the start time for the certificate's validity period. */ public Date getNotBefore() { return x509Certificate.getStartDate().getDate(); }
public String toString() { return getTime(); } }
public static Time getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(obj.getObject()); // must be explicitly tagged }
public void setNextUpdate( ASN1UTCTime nextUpdate) { this.nextUpdate = new Time(nextUpdate); }
/** * Return the date before which this certificate is not valid. * * @return the start time for the certificate's validity period. */ public Date getNotBefore() { return x509Certificate.getStartDate().getDate(); }
public void checkValidity( Date date) throws CertificateExpiredException, CertificateNotYetValidException { if (date.getTime() > this.getNotAfter().getTime()) // for other VM compatibility { throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime()); } if (date.getTime() < this.getNotBefore().getTime()) { throw new CertificateNotYetValidException("certificate not valid till " + c.getStartDate().getTime()); } }
public Time getRevocationDate() { return Time.getInstance(seq.getObjectAt(1)); }
public void setEndDate( ASN1UTCTime endDate) { this.endDate = new Time(endDate); }
/** * Return whether or not this certificate is valid on a particular date. * * @param date the date of interest. * @return true if the certificate is valid, false otherwise. */ public boolean isValidOn(Date date) { return !date.before(x509Certificate.getStartDate().getDate()) && !date.after(x509Certificate.getEndDate().getDate()); }
public void checkValidity( Date date) throws CertificateExpiredException, CertificateNotYetValidException { if (date.getTime() > this.getNotAfter().getTime()) // for other VM compatibility { throw new CertificateExpiredException("certificate expired on " + c.getEndDate().getTime()); } if (date.getTime() < this.getNotBefore().getTime()) { throw new CertificateNotYetValidException("certificate not valid till " + c.getStartDate().getTime()); } }
private OptionalValidity(ASN1Sequence seq) { Enumeration en = seq.getObjects(); while (en.hasMoreElements()) { ASN1TaggedObject tObj = (ASN1TaggedObject)en.nextElement(); if (tObj.getTagNo() == 0) { notBefore = Time.getInstance(tObj, true); } else { notAfter = Time.getInstance(tObj, true); } } }
public void setStartDate( DERUTCTime startDate) { this.startDate = new Time(startDate); }