You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Prakasa Nedunuri <pn...@cisco.com> on 2004/06/30 20:56:08 UTC

Generating X509 certificate

Hi,
   I am not sure if this is right forum but sending it since I am building 
my code based
on wss4j code.

I am trying to generate X509 certificate from byteArrayInputStream as follows.

ByteArrayInputStream in = new ByteArrayInputStream(data);

try {
CertificateFactory certFact = CertificateFactory.getInstance("X.509");
cachedCert = (X509Certificate)certFact.generateCertificate(in);
} catch (CertificateException ex) {
        throw new WSSecurityException(
                         WSSecurityException.SECURITY_TOKEN_UNAVAILABLE,
                         "parseError");
}

The problem I am having is that the CertificateFactory.getInstance("X.509")
is returning me null. Do I have to initialize something before calling
this method?

Appreciate your help in advance.

Thanks,
Prakasa
Prakasa Nedunuri
Application-Oriented Network Systems
Cisco Systems
408-853-8540