[Patch] gnu.java.security merged
Michael Koch
konqueror@gmx.de
Fri Apr 22 18:17:00 GMT 2005
Hi list,
I just commited the attached patch to merge gnu.java.security with GNU
classpath again.
Michael
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.
-------------- next part --------------
Index: gnu/java/security/der/DERValue.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/security/der/DERValue.java,v
retrieving revision 1.2
diff -u -r1.2 DERValue.java
--- gnu/java/security/der/DERValue.java 30 Aug 2004 13:06:48 -0000 1.2
+++ gnu/java/security/der/DERValue.java 22 Apr 2005 18:14:48 -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: /cvs/gcc/gcc/libjava/gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java,v
retrieving revision 1.2
diff -u -r1.2 PrivateKeyUsagePeriod.java
--- gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java 18 Apr 2005 18:40:27 -0000 1.2
+++ gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java 22 Apr 2005 18:14:48 -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;
More information about the Java-patches
mailing list