Import private key from PEM file?

Nguyễn Hồng Quân quannguyen at mbm.vn
Mon Jun 18 11:16:22 CEST 2012


Hi,
I tried again but "gpgsm --list-secrret-keys" still return nothing:

hongquan at Pangolin ~/Works/Certificates/StartCom $ gpgsm -v --import 
quannguyen at mbm.vn.p12
gpgsm: gpgsm: GPG_TTY has not been set - using maybe bogus default
gpgsm: gpg-protect-tool: 1224 bytes of 3DES encrypted text
gpgsm: gpg-protect-tool: 5904 bytes of RC2 encrypted text
gpgsm: gpg-protect-tool: processing certBag
gpgsm: gpg-protect-tool: processing certBag
gpgsm: gpg-protect-tool: processing certBag
gpgsm: gpg-protect-tool: keygrip: 
89E5CF0B2581EE779B2CF2D849EE991DEE0E1A17
gpgsm: gpg-protect-tool: secret key file 
`/home/hongquan/.gnupg/private-keys-v1.d/89E5CF0B2581EE779B2CF2D849EE991DEE0E1A17.key' 
already exists
gpgsm: certificate is good
gpgsm: certificate is good
gpgsm: certificate is good
gpgsm: total number processed: 4
gpgsm:              unchanged: 3
gpgsm:       secret keys read: 1
gpgsm:  secret keys unchanged: 1
hongquan at Pangolin ~/Works/Certificates/StartCom $ gpgsm 
--list-secret-key
/home/hongquan/.gnupg/pubring.kbx
---------------------------------
hongquan at Pangolin ~/Works/Certificates/StartCom $ gpgsm 
--list-secret-keys
/home/hongquan/.gnupg/pubring.kbx
---------------------------------

How about importing from PEM file? Is there a command to do that?

On Mon 18 Jun 2012 04:04:56 PM ICT, Werner Koch wrote:
> On Mon, 18 Jun 2012 10:08, quannguyen at mbm.vn said:
>
>> Is it possible to import pairs of certificate/private key from p12 file
>> using gpgsm?
>
> Sure, you may import pkcs#12 files.  The pinentry will ask you for the
> transport passphrases and for the new passphrase under which gpg-agent
> will store the key.  The code even tries several passphrase encodings to
> work around common encoding problems.
>
>   gpgsm -v --import foo.p12
>
> is all you need.  Watch out for the pinentry and any error messages you
> may see.  In case of problems, it is useful to enable gpg-agent
> debugging.
>
>
> Salam-Shalom,
>
>    Werner
>

--
Regards,
Quân



More information about the Gnupg-users mailing list