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

Re: [iaik-jce] PKCS7CertList



This certificate chain carrying SignedData object has not been wrapped into a ContentInfo, so use SignedData directly for reading the certs, e.g.:
 
SignedData sd = new SignedData(new ASN1InputStream(new FileInputStream(args[0])));
     chain = sd.getCertificates();
     for (int i = 0; i < chain.length; i++) {
       System.out.println(chain[i].toString(true));  
}
 
Dieter Bratko
 
----- Original Message -----
From: Alexandr Novikov <runtime@rb.dp.ua>
To: <iaik-jce@iaik.tu-graz.ac.at>
Sent: Wednesday, June 30, 1999 4:00 PM
Subject: [iaik-jce] PKCS7CertList


> Hello!
>
>   I have sample code:
>     public static void main(String args[]) throws Exception {
>         PKCS7CertList cl = new PKCS7CertList(new ASN1InputStream(new
FileInputStream(args[0])));
>         X509Certificate[] chain = cl.getCertificateList();
>         X509CRL[] chain_crl = cl.getCRLList();
>         //... some useful code
>     }
>   I use Sun jdk 1.1.8 with jdk11x_update.jar and IAIK JCE 2.51.
> I've recieved Thawte free certificate(certificate chain?, imho) and want
to see
> what's in it. I got following:
> java.io.IOException: Next ASN.1 object is no OBJECT IDENTIFIER!
>         at iaik.asn1.DerInputStream.readObjectID(Unknown Source)
>         at iaik.pkcs.pkcs7.ContentInfo.decode(Unknown Source)
>         at iaik.pkcs.pkcs7.ContentInfo.<init>(Unknown Source)
>         at iaik.pkcs.PKCS7CertList.<init>(Unknown Source)
>         at viewPKCS7CertList.main(viewPKCS7CertList.java:10)
>
>    Any ideas, why?
>    Thanx in advance.
>
>
>
> With the best wishes,               mailto:runtime@rb.dp.ua
>             Alexandr.
> ---------------------
> JS Bank "Radabank", Ukraine,
> +380-562-387832

smime.p7s