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

Re: [iaik-jce] Using PKCS12 - Help Needed



Yes, private key encryption is mandatory. If you supply a KeyBag which yet
is not a PKCS8ShroudedKeyBag, the PKCS12 constuctor automatically creates a
PKCS8ShroudedKeyBag from your KeyBag, and subsequently you have to call the
encrypt method on your PKCS12 object. See the PKCS12Create demo source
(IAIK-JCE 2.5 final) for an example on how to create a PKCS12 object.
The string parameter of the main method specifies a file name to which the
PKCS12 object is written (see demo source).

Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: Alan Grenadir <alang@lexias.com>
An: IAIK <iaik-jce@iaik.tu-graz.ac.at>
Gesendet: Mittwoch, 02. Juni 1999 02:02
Betreff: [iaik-jce] Using PKCS12 - Help Needed


> I am attempting to export a private key and certificate from my
> application using the PKCS12 class.  I am having the following
> difficulty.
>
> I am using the PKCS12 constructor which takes a KeyBag and a
> CertificateBag array.  II have a KeyBag constructed from an RSA private
> key (no added attributes).  I also have a CertificateBag array of length
> one containing a self-signed certificate created from the default
> iaik.x509.X509Certificate using the setXXX methods.  Both components
> display properly using the toString( ) methods.
>
> When I call the toString( ) method or the writeTo( ) method on this
> PKCS12 object, I get a NullPointerException.  What else must I do so
> that the PKCS12 object will be OK?  For example, is it mandatory that
> the PrivateKey or the entire PKCS12 object be (password) protected?
>
> In addition, could you provide more information on the PKCS12Create
> class - the format of the parameters to the main( ) routine and how to
> use the start(String) method.  Is there (planned) a TestPKCS12.java file
> in the demo directory of some JCE release?
>
> Thanks
>
> --
> Mailinglist-archive at
http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html
>
> To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the
folowing content: UNSUBSCRIBE iaik-jce
>
>
>


smime.p7s