-
Bug
-
Resolution: Fixed
-
P4
-
1.3.0
-
beta
-
generic
-
generic
Name: boT120536 Date: 11/09/2000
Not applicable - documentation error.
From the javadoc for java.security.cert.CertificateFactory
> FileInputStream fis = new FileInputStream(filename);
> DataInputStream dis = new DataInputStream(fis);
>
> CertificateFactory cf = CertificateFactory.getInstance("X.509");
>
> byte[] bytes = new byte[dis.available()];
> dis.readFully(bytes);
> ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
This code is broken, dis.avaliable() does not equal length of fis. Please
don't include broken code in javadoc as inexperienced programmers, foolishly
I'll admit, think examples should be correct. No liability assumed, but you
would probably save a few other people out there a bit of pain if you fix this.
(Review ID: 110798)
======================================================================
- relates to
-
JDK-4391749 JCA spec contains broken example code for generating certificates
-
- Closed
-