convert pfx to use with cryptlib

View: New views
4 Messages — Rating Filter:   Alert me  

convert pfx to use with cryptlib

by GuTyKa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello!

I would like to use a certificate and key pair exported from Internet
Explorer in PFX format. I've managed to make a PEM file out of it by
using openssl:
$> openssl pkcs12 -in file.pfx -out file.pem

Then I've tried to use pemtrans to make a P15 file that can be used with
crytlib, but it says:

$> pemtrans file.pem file.pem file.p15 "Customer Name" password
Couldn't load private key from 'file.pem'
25948:error:0906D06C:lib(9):func(109):reason(108):pem_lib.c:644:Expecting:
ANY PRIVATE KEY

Maybe someone can help. I'm sure it's not hard to convert I'm just
missing something :)

Thanks for help!

_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.

Re: convert pfx to use with cryptlib

by GuTyKa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> Hello!
>
> I would like to use a certificate and key pair exported from Internet
> Explorer in PFX format. I've managed to make a PEM file out of it by
> using openssl:
> $> openssl pkcs12 -in file.pfx -out file.pem
>
> Then I've tried to use pemtrans to make a P15 file that can be used with
> crytlib, but it says:
>
> $> pemtrans file.pem file.pem file.p15 "Customer Name" password
> Couldn't load private key from 'file.pem'
> 25948:error:0906D06C:lib(9):func(109):reason(108):pem_lib.c:644:Expecting:
> ANY PRIVATE KEY
>
> Maybe someone can help. I'm sure it's not hard to convert I'm just
> missing something :)
>
> Thanks for help!
>

Noone ever had a similar issue? :( I'd like to convert PKCS#12 to
PKCS#15. Is it possible?

Thank you!

_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.

Re: convert pfx to use with cryptlib

by Daniel Plaza :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

El mar, 21-04-2009 a las 13:13 +0200, GuTyKa escribió:

> > Hello!
> >
> > I would like to use a certificate and key pair exported from Internet
> > Explorer in PFX format. I've managed to make a PEM file out of it by
> > using openssl:
> > $> openssl pkcs12 -in file.pfx -out file.pem
> >
> > Then I've tried to use pemtrans to make a P15 file that can be used with
> > crytlib, but it says:
> >
> > $> pemtrans file.pem file.pem file.p15 "Customer Name" password
> > Couldn't load private key from 'file.pem'
> > 25948:error:0906D06C:lib(9):func(109):reason(108):pem_lib.c:644:Expecting:
> > ANY PRIVATE KEY
> >
> > Maybe someone can help. I'm sure it's not hard to convert I'm just
> > missing something :)
> >
> > Thanks for help!
> >
>
> Noone ever had a similar issue? :( I'd like to convert PKCS#12 to
> PKCS#15. Is it possible?
>
> Thank you!

See the pemtrans man page. Private key and certificate file should be in
different files.


_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.

Re: convert pfx to use with cryptlib

by Peter Rybar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That is easy.

If you have ASN.1 encoder/decoder

then read the PKCS12

decrypt it

and then create a new encrypted PKCS15.



There is only one problem which I have

That was the parity bit in PKCS12 DES encryption must be ignored :o)

And PKCS15 used by PeterG is according draft and not according the final
version of PKCS15.



Peter


----- Original Message -----
From: "GuTyKa" <gutyka@...>
To: <cryptlib@...>
Sent: Tuesday, April 21, 2009 1:13 PM
Subject: Re: [Cryptlib] convert pfx to use with cryptlib


>
>> Hello!
>>
>> I would like to use a certificate and key pair exported from Internet
>> Explorer in PFX format. I've managed to make a PEM file out of it by
>> using openssl:
>> $> openssl pkcs12 -in file.pfx -out file.pem
>>
>> Then I've tried to use pemtrans to make a P15 file that can be used with
>> crytlib, but it says:
>>
>> $> pemtrans file.pem file.pem file.p15 "Customer Name" password
>> Couldn't load private key from 'file.pem'
>> 25948:error:0906D06C:lib(9):func(109):reason(108):pem_lib.c:644:Expecting:
>> ANY PRIVATE KEY
>>
>> Maybe someone can help. I'm sure it's not hard to convert I'm just
>> missing something :)
>>
>> Thanks for help!
>>
>
> Noone ever had a similar issue? :( I'd like to convert PKCS#12 to PKCS#15.
> Is it possible?
>
> Thank you!
>
> _______________________________________________
> Cryptlib mailing list
> Cryptlib@... via Mail:
> cryptlib-request@...
> Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
> http://news.gmane.org/gmane.comp.encryption.cryptlib
> Posts from non-subscribed addresses are blocked to prevent spam, please
> subscribe in order to post messages.
>


_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.