Rajanikanth
Rajanikanth

Reputation: 41

gpgsm -a --export-secret-key-p12 [keyid] under windows showing error message "No secret key"

have installed the gpg4win version 2.2. I have Successfully created the certificate using gpgsm --gen-key > test.p10

I want to export the created certificate request into pkcs12 format with gpgsm --export-secret-key-p12, but while exporting into p12 i get the error message "No Secret key"

When i run gpgsm --list-secret-keys on command prompt,it indeed displays nothing.

Why would the export step is fail? and where the secret keys are present while generating certificates?

Upvotes: 4

Views: 2291

Answers (1)

Andre Heinecke
Andre Heinecke

Reputation: 616

I have Successfully created the certificate using gpgsm --gen-key > test.p10

GpgSM from gpg4win-2.x only can generate certificate signing requests.

It stores the secret part of your certificate under %APPDATA%\gnupg\private-keys-v1.d and prints out the signing request. That singing request is supposed to be sent to a Certificate Authority that signs your certificate (like cacert).

You then import the signed certificate and it will then show up unter --list-secret-keys and will be exportable.

With GnuPG 2.1 (can be downloaded as windows installer from gnupg.org) you are asked when generating a key if you want to selfsign it. In that case your "test.p10" would contain the signed certificate that you can then import into gpgsm and use / export it directly without the need for a CA.

Upvotes: 1

Related Questions