GPG Error – ‘no secret key’ Despite –list-secret-keys and –sign Working

gpg

I would like to refresh the UIDs and postpone the expiration date but I get.

gpg --edit-key n.dwek@hotmail.com 
gpg (GnuPG) 2.1.15; Copyright (C) 2016 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.

Secret key is available.

pub  rsa4096/0x03FFE7DE7AEFDD3B
     created: 2014-09-21  expires: 2017-09-20  usage: SC  
     trust: ultimate      validity: ultimate
ssb  rsa4096/0x612502E7B5475FF9
     created: 2014-09-21  expires: 2017-09-20  usage: E   
ssb  rsa4096/0x6777F12E17534B8E
     created: 2014-09-21  expires: 2017-09-20  usage: S   
[ultimate] (1). Nathan DWEK <dwek95@hotmail.com>
[ultimate] (2)  Nathan DWEK <n.dwek@hotmail.com>

gpg> expire
Changing expiration time for the primary key.
gpg: WARNING: no user ID has been marked as primary.  This command may
              cause a different user ID to become the assumed primary.
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 2y
Key expires at jeu 19 sep 2019 12:19:31 CEST
Is this correct? (y/N) y
gpg: signing failed: No secret key
gpg: make_keysig_packet failed: No secret key

However:

gpg --list-secret-keys 
/home/nathdwek/.gnupg/pubring.gpg
---------------------------------
sec#  rsa4096/0x03FFE7DE7AEFDD3B 2014-09-21 [SC] [expires: 2017-09-20]
      Key fingerprint = 1A12 B5ED F67A 947C B616  6FCC 03FF E7DE 7AEF DD3B
uid                   [ultimate] Nathan DWEK <dwek95@hotmail.com>
uid                   [ultimate] Nathan DWEK <n.dwek@hotmail.com>
ssb   rsa4096/0x612502E7B5475FF9 2014-09-21 [E] [expires: 2017-09-20]
ssb   rsa4096/0x6777F12E17534B8E 2014-09-21 [S] [expires: 2017-09-20]

Signing and using pass, a gpg-based password manager has been working perfectly for a long time. I am on Ubuntu 17.04 with cinnamon.

Best Answer

I was using an offline master key and used subkeys for signing and decryption. This was displayed by the # in front of my master key.

This is why the only operations I could not perform were key signing operations.

Related Question