[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-ssl] unable to verify certificate !!



Title: unable to verify certificate !!

Hi All,
I am getting a certificate in PEM format (Base64). I have created a X509Certificate object out of this PEM encoded certificate. I am able to extract certificate info like issuer, serial no etc from the certificate.

But when I call verify on this certificate object (using its public key). I get the exception which is pasted below. I have added IAIK as the providers (Security.addProvider(new IAIK()) )

I will be highly grateful if anybody can help me.
regards,
Siddhartha

<code>
try {
byte[] bytes = clientCert.getBytes();
iaik.x509.X509Certificate certsObject = new iaik.x509.X509Certifcate(bytes);
int length = Security.getProviders().length;
Provider[]  providers = new Provider[length-1];
providers=Security.getProviders();
for(int i=0;i<length;i++)
out.println("providers["+i+"]"+ providers[i].toString());

//out.println("the provider is " + Security.getProviders());
certsObject.verify(certsObject.getPublicKey());
</code>

<Provider>
providers[0]IAIK version 2.0
providers[1]SUN version 1.2
</Provider>

<Exception>
java.lang.IllegalArgumentException: missing provider at java.security.Signature.getInstance(Signature.java, Compiled Code) at iaik.x509.X509Certificate.verify(X509Certificate,

Compiled Code) at iaik.x509.X509Certificate.verify(X509Certificate, Compiled Code) at Hello.doGet(Hello.java, Compiled Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled

Code) at javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled Code) at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java, Compiled Code) exception occurred

java.lang.IllegalArgumentException: missing provider
</Exception>