# read certificate

Zhang, Hua (HZhang@sempra.com)
Mon, 15 Mar 1999 14:03:20 -0800

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Charlie Lai: "Re: sun.security.acl.*"
- Previous message: Frank Yellin: "RE: Getting a CA-signed certificate. . . Futility"
- Next in thread: Jan Luehe: "Re: read certificate"

    From: "Zhang, Hua" <HZhang@sempra.com>

    To: "'java-security@java.sun.com'" <java-security@java.sun.com>

    Subject: read certificate

    Date: Mon, 15 Mar 1999 14:03:20 -0800

Hi,

We are developing a certificate based log in mechanism. I am trying to read
certificate from a file using the following code as shown in JAVA
documentation:

InputStream inStream = new
FileInputStream("c:\\jdk12Test\\security\\testCert1.p12");
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream);
inStream.close();

I got the following stack trace:

java.security.cert.CertificateParsingException: signed overrun, bytes = 53
at sun.security.x509.X509CertImpl.parse(X509CertImpl.java:1022)
at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:150)
at
sun.security.provider.X509Factory.engineGenerateCertificate(X509Facto
ry.java:93)
at
java.security.cert.CertificateFactory.generateCertificate(Certificate
Factory.java:290)
at security.TestCert.main(TestCert.java:14)

The certificate file is exported from Netscape Web Browser. The certificate
is issued by VeriSign as Personal X509 Certificate. If this particular
certificate format is not supported by JAVA, which type of certificate from
what CAs are supported ? Also, when installing a certificate into Netscape
Browser, the Browser will create a private key for the Certificate, how do
I retrieve this private key in JAVA ?

-----------------------------------------------------
Hua Zhang
Transnation Partner II/Component Arts LLC
hzhang@sempra.com
Phone: (619)-547-1401
Fax:(619)-547-1480
-----------------------------------------------------

- Next message: Charlie Lai: "Re: sun.security.acl.*"
- Previous message: Frank Yellin: "RE: Getting a CA-signed certificate. . . Futility"
- Next in thread: Jan Luehe: "Re: read certificate"