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

[iaik-jce] Problems while creating a RSAPrivateKey from file



Hi there,

I'm writing an application which uses https to communicate with a bea
application sever. to establish an ssl connection I've to load a certivicate
(X509) and an private key. Both are stored as so called .pem files,
following

-----BEGIN CERTIFICATE-----
MIICvDCCAiWgAwIBAgICCxowDQYsWSNqYw5gZDwZZb0L
...
m8Z6jENTXzsvCltC0F62OlV5MuJfXQVMavrSy5skqNM=
-----END CERTIFICATE-----

and

-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDBAyV22zhmXseyvNKg6kUnigsGW4YAMcamXKEA+PbaHfoeBmg1
...
Um27Xpl17ZQMlnVCJsmNAkASKIhFK4F2gA7rgSUAXbcfvN855X/Gf9VXH25xtxYM
NaoMfVhVI99KVD8rxJ4/Fv63nSEj0+65jexnPfa0eQJ8
-----END RSA PRIVATE KEY-----

While I have no problem to read the certificate ( using X509Certificate
publicX509 = new X509Certificate( new FileInputStream( CertFilename )); ),
every try to import the private key fails.
I tried something like

RSAPrivateKey privateKey = new RSAPrivateKey( new FileInputStream(
privateKeyFilename) );

for an input stream as well as for a byte[] containing the file, but even if
I did a base64 decoding for the byte array, it fails saying "No
PrivateKeyInfo"

Any help would be appreciated

Axel
------------------------------
Axel Wernicke
Softwareentwickler

IXOS Anwendungs-Software GmbH	Phone: +49.341.48503.84
Nonnenstraße 39	Fax:      +49.341.48503.99
D-04229 Leipzig	E-Mail: axel.wernicke@ixos-leipzig.de
                                   	World Wide Web: http://www.ixos.de




--
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: Axel Wernicke <axel.wernicke@ixos-leipzig.de>                   *
*   Date: Thu, 27 Jul 2000 14:15:50 +0200                                 *
*   Subject: [iaik-jce] Problems while creating a RSAPrivateKey from file *
*                                                                         *
* 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)               *
*                                                                         *
***************************************************************************