Could not extend expiration date

I wasn’t able to extend the validity of my gpg key, because instead of promting me with the passphase request I got this error:

gpg> expire
Cambio la data di scadenza per la chiave primaria.
Per favore specifica per quanto tempo la chiave sarÓ valida.
0 = la chiave non scadrÓ
= la chiave scadrÓ dopo n giorni
w = la chiave scadrÓ dopo n settimane
m = la chiave scadrÓ dopo n mesi
y = la chiave scadrÓ dopo n anni
Chiave valida per? (0) 2y
Key expires at 02/05/16 23:42:02 W. Europe Standard Time
Is this correct? (y/N) y
gpg: parti della chiave segreta non sono disponibili
gpg: make_keysig_packet failed: Unusable secret key

but I’ve a private key, and I’m able both to sign and decrypt.

Anyone can help?

thanks

Hi,
a general remark: Please include the version of Gpg4win and the operating
system that you are using.

If signing works on the command line, I think it is rather strange that you cannot change the date. Can you try to run the command line in an English version for reporting?
(I haven’t tried it, but maybe
set LANG=C
does this in a cmd.com.)

Just a few more ideas:

  • is gpg-agent running fine?
  • add -v or -vvv or --debug to see more messages.

Version Info: SO is Windows 7

set LANG=en

C:\Users\me>gpg --help
gpg (GnuPG) 2.0.22 (Gpg4win 2.2.1)
libgcrypt 1.5.3
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: C:\Users\me\AppData\Roaming\gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ?, ?
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Signing a document is ok

C:\Users\me\Downloads>gpg -vvv -s volterra_saggi_scientifici.epub
gpg: using character set `CP850’
gpg: using PGP trust model
gpg: key 3D2B665D: accepted as trusted key
gpg: using subkey 658682A5 instead of primary key 3D2B665D

You need a passphrase to unlock the secret key for
user: “MyName repl@ced
gpg: using subkey 658682A5 instead of primary key 3D2B665D
2048-bit DSA key, ID 658682A5, created 2012-02-26 (main key ID 3D2B665D)

File volterra_saggi_scientifici.epub.gpg' exists. Overwrite? (y/N) y gpg: writing to volterra_saggi_scientifici.epub.gpg’
gpg: DSA/SHA256 signature from: “658682A5 MyName repl@ced

Editing to extend expiration date fails

C:\Users\me\Downloads>gpg -vvv --edit-key repl@ced
gpg (GnuPG) 2.0.22; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: using character set `CP850’
gpg: using PGP trust model
gpg: key 3D2B665D: accepted as trusted key
Secret key is available.

pub 2048D/3D2B665D created: 2012-02-16 expires: 2014-02-16 usage: SC
trust: ultimate validity: ultimate
sub 3072g/791B80B4 created: 2012-02-16 expires: 2014-02-16 usage: E
sub 2048D/658682A5 created: 2012-02-26 expires: 2014-02-25 usage: S
[ultimate] (1). MyName repl@ced

gpg> expire
Changing expiration time for the primary key.
Please specify how long the key should be valid.
0 = key does not expire
= key expires in n days
w = key expires in n weeks
m = key expires in n months
y = key expires in n years
Key is valid for? (0) 2y
Key expires at 02/07/16 20:28:52 W. Europe Standard Time
Is this correct? (y/N) y
gpg: secret key parts are not available
gpg: make_keysig_packet failed: Unusable secret key

Yes, this information is a lot more explicit!

It does not give me an idea what is wrong, thought. :confused:
One option you have is to subscribe and ask on the gnupg-users list.

Ok I’ll ask on that list.

Thanks for your time