Create p12 from a .pem with only a private key

Dirk-Willem van Gulik dirkx at webweaving.org
Thu Feb 20 07:45:30 UTC 2020


> On 20 Feb 2020, at 08:43, Dirk-Willem van Gulik <dirkx at webweaving.org> wrote:
>> On 20 Feb 2020, at 08:38, Estefania <stefy83 at gmail.com> wrote:
>> I would like to ask if it is possible to create a p12 just with a .pem with
>> private key but not certificate.
> 
> Try
> 
> 	openssl req -x509 -subj /CN=foo -keyout /dev/null -nodes | openssl pkcs12 -out sample.p12 -export -ce rts
> 
> to make one containing just one cert without a private key.

Sorry - that should be

	openssl req -x509 -subj /CN=foo -keyout /dev/null -nodes | openssl pkcs12 -out x.p12 -export -nokeys

and

	openssl pkcs12 -in x.p12

to test.

Dw.


More information about the openssl-users mailing list