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

RE: [iaik-jce] Help: PKCS12 into Netscape 4.72




----- Original Message -----
From: Gabriel Lopez <gabilm@dif.um.es>
To: <iaik-jce@iaik.at>
Subject: [iaik-jce] Help: PKCS12 into Netscape 4.72


The problems is that Netscape needs a FriendlyName and KeyId in KeyBags and
in CertBags. We use these options and
the import ion Netscape works fine.

The code example :

            FileOutputStream osPkcs12 = new FileOutputStream(pkcs12f);

            byte[] keyId = new byte[] {0x01, 0x02, 0x03, 0x04}; // We use a
digest of public key instead of this
            String cName = ((Name) cert.
getSubjectDN()).getRDN(ObjectID.commonName);
            KeyBag keyBag = new KeyBag(epk.getPrivateKeyInfo(), cName,
keyId);

            CertificateBag[] certBags = new CertificateBag[1];
            certBags[0] = new CertificateBag(cert);
            certBags[0].setFriendlyName(cName);
            certBags[0].setLocalKeyID(keyId);

            PKCS12 pkcs12_out = new PKCS12(keyBag, certBags, true);
            pkcs12_out.encrypt(password);
            pkcs12_out.writeTo(osPkcs12);
            osPkcs12.close();


Un saludo...

----------------------------------------------------------------------------
------------------------
Jacobo Matute Troncoso. ( jmatute@ull.es )
Centro de Comunicaciones y Tecnologías de la Información (CCTI)
Universidad de La Laguna
Islas Canarias
España
----------------------------------------------------------------------------
------------------------

--
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


***************************************************************************
*                                                                         *
* IAIK S/MIME Mapper Security Info                                        *
* ===================================                                     *
*                                                                         *
* for message:                                                            *
*   From: "Jacobo Matute" <jmatute@ull.es>                                *
*   Date: Tue, 28 Nov 2000 12:07:13 -0000                                 *
*   Subject: RE: [iaik-jce] Help: PKCS12 into Netscape 4.72               *
*                                                                         *
* Message S/MIME properties:                                              *
*                                                                         *
*   Encrypted using:    not encrypted                                     *
*                                                                         *
*   Digitally signed:   no                                                *
*   Signature valid:    n/a                                               *
*   Signature trusted   n/a                                               *
*                                                                         *
*                                                                         *
* Compliance with policy for email addresses *:                           *
*                                                                         *
*   Encryption:         OK (None or better required)                      *
*                                                                         *
*   Digital Signature:  OK (digital signature not required)               *
*                                                                         *
***************************************************************************