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

AW: [iaik-jce] Pb sending signed messages with certificates from an other CA



You have to ensure to use the right classes for reading keys/certificates:

iaik.x509.X509Certificate for reading simply DER encoded X.509 certificates
(suffix .der, .cer

iaik.pkcs.PKCS7CertList for reading cert chains given in PKCS#7 format
(suffix p7c, p7b)

iaik.pkcs12.PKCS12 for reading CertAndPrivateKeys given in PKCS#12 format
(suffix pfx, p12)

iaik.pkcs.NetscapeCertList for reading certs given in Netscape Certificate
Sequence format.

Look at the demo sources and Javadoc examples on how to do.

Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at
[mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von alegrand@gnt.ch
Gesendet: Mittwoch, 29. März 2000 12:06
An: iaik-jce@iaik.tu-graz.ac.at
Betreff: [iaik-jce] Pb sending signed messages with certificates from an
other CA


Hi,


1) key creation
We have defined a CA with Microsoft Certificate Service, then created keys
certified by this CA.
The key have been built with the "export private key" option.

The key have been directly installed in IE5 by this tool.
In outlook, A sends a signed message to B.

2) storing keys into files
In order to send signed messages with SMIMESend Sample

B exports this key into a file, say APubKey.cer
B exports from IE5 its own key (including private key) into a file
BPrivKey.pfx.
B exports from IE5 its own key (excluding private key) into a file
BPubKey.cer.

3) running SMIMESend
the source code of SMIMESend() is removed.
In start(), getting certificates of A and B :
     recipientCertificate = new X509Certificate(new FileInputStream("C:
\\APubKey.cer"));
     signerCertificate = new X509Certificate(new FileInputStream("C:
\\BPubKey.cer"));
     signerPrivateKey = (new EncryptedPrivateKeyInfo(new FileInputStream
("C:\\BPrivKey.pfx"))).getPrivateKeyInfo();

exceptions are catched and the programs throws the exception, when getting
the private key.
    iaik.asn1.CodingException: No ASN.1 AlgorithmID type!



Any help welcome !

André


--
Mailinglist-archive at
http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content:
UNSUBSCRIBE iaik-jce




smime.p7s