public PackedDate( String time) { this.time = convert(time); }
/** * return the time as a date based on whatever a 2 digit year will return. For * standardised processing use getAdjustedDate(). * * @return the resulting date * @exception java.text.ParseException if the date string cannot be parsed. */ public Date getDate() throws ParseException { SimpleDateFormat dateF = new SimpleDateFormat("yyyyMMdd"); return dateF.parse("20" + toString()); }
/** * @return the date of the certificate generation */ public PackedDate getCertificateEffectiveDate() { if ((this.certificateType & CertificateBody.CEfD) == CertificateBody.CEfD) { return new PackedDate(certificateEffectiveDate.getContents()); } return null; }
false, EACTags.APPLICATION_EFFECTIVE_DATE, new DEROctetString(certificateEffectiveDate.getEncoding()))); setCertificateExpirationDate(new DERApplicationSpecific( false, EACTags.APPLICATION_EXPIRATION_DATE, new DEROctetString(certificateExpirationDate.getEncoding())));
/** * @return the date of the certificate generation */ public PackedDate getCertificateEffectiveDate() { if ((this.certificateType & CertificateBody.CEfD) == CertificateBody.CEfD) { return new PackedDate(certificateEffectiveDate.getContents()); } return null; }
false, EACTags.APPLICATION_EFFECTIVE_DATE, new DEROctetString(certificateEffectiveDate.getEncoding()))); setCertificateExpirationDate(new DERApplicationSpecific( false, EACTags.APPLICATION_EXPIRATION_DATE, new DEROctetString(certificateExpirationDate.getEncoding())));
public PackedDate( String time) { this.time = convert(time); }
/** * @return the date after wich the certificate expires */ public PackedDate getCertificateExpirationDate() throws IOException { if ((this.certificateType & CertificateBody.CExD) == CertificateBody.CExD) { return new PackedDate(certificateExpirationDate.getContents()); } throw new IOException("certificate Expiration Date not set"); }
/** * return the time as a date based on whatever a 2 digit year will return. For * standardised processing use getAdjustedDate(). * * @return the resulting date * @exception java.text.ParseException if the date string cannot be parsed. */ public Date getDate() throws ParseException { SimpleDateFormat dateF = new SimpleDateFormat("yyyyMMdd"); return dateF.parse("20" + toString()); }
/** * Base constructor from a java.util.date object. * * @param time a date object representing the time of interest. */ public PackedDate( Date time) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMdd'Z'"); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = convert(dateF.format(time)); }
/** * @return the date after wich the certificate expires */ public PackedDate getCertificateExpirationDate() throws IOException { if ((this.certificateType & CertificateBody.CExD) == CertificateBody.CExD) { return new PackedDate(certificateExpirationDate.getContents()); } throw new IOException("certificate Expiration Date not set"); }
/** * Base constructor from a java.util.date object. * * @param time a date object representing the time of interest. */ public PackedDate( Date time) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMdd'Z'"); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = convert(dateF.format(time)); }
/** * Base constructor from a java.util.date object. You may need to use this constructor if the default locale * doesn't use a Gregorian calender so that the PackedDate produced is compatible with other ASN.1 implementations. * * @param time a date object representing the time of interest. * @param locale an appropriate Locale for producing an ASN.1 GeneralizedTime value. */ public PackedDate( Date time, Locale locale) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMdd'Z'", locale); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = convert(dateF.format(time)); }
/** * Base constructor from a java.util.date object. You may need to use this constructor if the default locale * doesn't use a Gregorian calender so that the PackedDate produced is compatible with other ASN.1 implementations. * * @param time a date object representing the time of interest. * @param locale an appropriate Locale for producing an ASN.1 GeneralizedTime value. */ public PackedDate( Date time, Locale locale) { SimpleDateFormat dateF = new SimpleDateFormat("yyMMdd'Z'", locale); dateF.setTimeZone(new SimpleTimeZone(0,"Z")); this.time = convert(dateF.format(time)); }