Reimporting key into gpgsm

Werner Koch wk at gnupg.org
Mon Jan 2 14:58:37 CET 2006


On Tue, 27 Dec 2005 17:16:07 +0100, Thomas Widhalm said:

> simple one. I deleted my whole keyring.kbx file and imported all anew but the 

keyring.kbx only contains public keys (aka certificates).  The private
keys are in  ~/.gnupg/private-keys-v1.d/.

To locate the actual used private key you best run 

gpgsm --dump-key userID

Which will give you something like

Serial number: 01509C
       Issuer: 1.2.840.113549.1.9.1=#737570706F7274406361636572742E6F7267,CN=CA Cert Signing Authority,OU=http://www.cacert.org,O=Root CA
      Subject: CN=trithemius.gnupg.org
          aka: (8:dns-name13:www.gnupg.org)
          aka: (8:dns-name15:lists.gnupg.org)
          aka: (8:dns-name14:bugs.gnupg.org)
     sha1_fpr: ED:05:C9:FD:A2:BB:57:F1:38:9D:61:C0:46:C9:9D:8A:AF:08:C7:24
      md5_fpr: EF:35:35:ED:6F:C7:64:1B:27:7A:7B:66:69:11:39:91
      keygrip: F6730C230858070D2DCCB448C3994DF8B4225946
    notBefore: 2005-07-21 16:51:43
     notAfter: 2007-07-21 16:51:43
     hashAlgo: 1.2.840.113549.1.1.4 (md5WithRSAEncryption)
      keyType: 1024 bit RSA
    subjKeyId: [none]
    authKeyId: [none]
     keyUsage: digitalSignature keyEncipherment
  extKeyUsage: clientAuth (suggested)
               serverAuth (suggested)
               serverGatedCrypto.ns (suggested)
               serverGatedCrypto.ms (suggested)
     policies: [none]
  chainLength: not a CA
        crlDP: [none]
     authInfo: 1.3.6.1.5.5.7.48.1
               http://ocsp.cacert.org
     subjInfo: [none]
         extn: 1.3.6.1.5.5.7.1.1 (authorityInfoAccess)  [38 octets]

Now take the keygrip line and you will find the key ay 

~/.gnupg/private-keys-v1.d/F6730C230858070D2DCCB448C3994DF8B4225946.key

To view the private key you may use

/usr/local/libexec/gpg-protect-tool  FILE

pgp-protect-tool might be installed under lib on your system.

> issue stays the same. Could anyone help me changing my passphrase within 

gpgsm --passwd 




Shalom-Salam,

   Werner




More information about the Gnupg-users mailing list