Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.3495 diff -u -b -B -r1.3495 ChangeLog --- ChangeLog 21 Apr 2005 06:01:38 -0000 1.3495 +++ ChangeLog 22 Apr 2005 04:18:17 -0000 @@ -1,3 +1,11 @@ +2005-04-21 Casey Marshall + + * gnu/java/security/der/DERValue.java + (getValueAs): new method. + * gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java + (): read both dates with 'DERValue.getValueAs', with + 'GENERALIZED_TIME' as the argument. + 2005-04-21 Michael Koch * include/gnu_java_nio_charset_iconv_IconvDecoder.h, Index: gnu/java/security/der/DERValue.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/der/DERValue.java,v retrieving revision 1.2 diff -u -b -B -r1.2 DERValue.java --- gnu/java/security/der/DERValue.java 14 Aug 2004 17:51:42 -0000 1.2 +++ gnu/java/security/der/DERValue.java 22 Apr 2005 04:18:17 -0000 @@ -119,6 +119,13 @@ return value; } + public Object getValueAs (final int derType) throws IOException + { + byte[] encoded = getEncoded (); + encoded[0] = (byte) derType; + return DERReader.read (encoded).getValue (); + } + public byte[] getEncoded() { if (encoded == null) Index: gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java =================================================================== RCS file: /cvsroot/classpath/classpath/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java,v retrieving revision 1.2 diff -u -b -B -r1.2 PrivateKeyUsagePeriod.java --- gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java 2 Mar 2005 17:46:26 -0000 1.2 +++ gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java 22 Apr 2005 04:18:17 -0000 @@ -71,14 +71,14 @@ val = der.read(); if (val.getTagClass() == DER.APPLICATION || val.getTag() == 0) { - notBefore = (Date) val.getValue(); + notBefore = (Date) val.getValueAs (DER.GENERALIZED_TIME); val = der.read(); } else notBefore = null; if (val.getTagClass() == DER.APPLICATION || val.getTag() == 1) { - notAfter = (Date) val.getValue(); + notAfter = (Date) val.getValueAs (DER.GENERALIZED_TIME); } else notAfter = null;