diff options
Diffstat (limited to 'libjava/gnu/java')
-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 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; |