From: mkoch Date: Fri, 22 Apr 2005 18:15:15 +0000 (+0000) Subject: 2005-04-22 Casey Marshall X-Git-Tag: upstream/4.9.2~61840 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15af37922b72699dcb980e6b644cb77be1fce9b0;p=platform%2Fupstream%2Flinaro-gcc.git 2005-04-22 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98578 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1a9c0ba..4fa341c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,11 @@ +2005-04-22 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-22 Andrew Pinski * gnu/gcj/runtime/NameFinder.java (close): IN, OUT, and PROC can all diff --git a/libjava/gnu/java/security/der/DERValue.java b/libjava/gnu/java/security/der/DERValue.java index bad7bed..9c3431e 100644 --- a/libjava/gnu/java/security/der/DERValue.java +++ b/libjava/gnu/java/security/der/DERValue.java @@ -119,6 +119,13 @@ public class DERValue implements DER 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) diff --git a/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java b/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java index 8e7e9e2..c56cd27 100644 --- a/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java +++ b/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java @@ -71,14 +71,14 @@ public class PrivateKeyUsagePeriod extends Extension.Value 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;