diff options
| author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-22 18:15:15 +0000 |
|---|---|---|
| committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-22 18:15:15 +0000 |
| commit | 15af37922b72699dcb980e6b644cb77be1fce9b0 (patch) | |
| tree | 018e25beaf955418969c675e6eab529a51cdb3bc /libjava/gnu | |
| parent | af1356a53b0d805c9dd0364a59580d0582de6203 (diff) | |
| download | ppe42-gcc-15af37922b72699dcb980e6b644cb77be1fce9b0.tar.gz ppe42-gcc-15af37922b72699dcb980e6b644cb77be1fce9b0.zip | |
2005-04-22 Casey Marshall <csm@gnu.org>
* gnu/java/security/der/DERValue.java
(getValueAs): new method.
* gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java
(<init>): 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
Diffstat (limited to 'libjava/gnu')
| -rw-r--r-- | libjava/gnu/java/security/der/DERValue.java | 7 | ||||
| -rw-r--r-- | libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/libjava/gnu/java/security/der/DERValue.java b/libjava/gnu/java/security/der/DERValue.java index bad7beda97d..9c3431e0b52 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 8e7e9e230a7..c56cd27cfbd 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; |

