On Wed, Mar 10, 2010, eoinmoon wrote:

> 
> I then exported the private key [in java code], checked it was in PKCS8 form
> - See below
> 
> "if (key instanceof PrivateKey && "PKCS#8".equals(key.getFormat())) {
>                     // Get certificate of public key
>                     keyOutput = new
> FileOutputStream("c:\\security\\priv.key");"
> 
> I then attempted to convert it using OpenSSL - see below
>         openssl pkcs8 -inform PEM -nocrypt -in c:\security\priv.key -out
> c:\security\pemkey.pem
> 
> What I get is the following error [note I have used several keys in the
> openssl command, the one above is one of them]
> 
> "Error decrypting key 4120:error:0906D06C:PEM routines:PEM_read_bio:no start
> line:.\crypto\pem\pem_lib
> .c:647:Expecting: PRIVATE KEY"
> 
> I have search for this error with no great results, I am no expert on
> Keystore but it is something I have to use - I need the private key and
> signed cert in PEM format , it is the key that is blocking me at the
> moment.... any ideas what I am doing wrong ?
> 

Try the -inform DER argument to the pkcs8 command.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to