I am a little confused (as many others) about the concept of subkeys as related to the primary key. gpg
by default (at least it seems on my system --- using RSA
), upon gpg --gen-key
creates a masterkey
and a subkey
. The masterkey
has flags SC
that it could be used for signing and certification. It also creates one subkey with flag E
, used for encryption. Are the following statements correct?
- If I understand the whole concept both the
masterkey
and thesubkey
are key pairs, that is a pair of private-public keys. - the fact that one is only for encryption is because some algorithms have such requirement (need separate keys for encryption and signature)
- The
subkey
withE
flag: its public part can be used to encrypt information and its private part to decrypt the information that was encrypted with the public part. - The
masterkey
withSC
flag: its private part is used to sign/certify and its public part is used to verify the validity of the signature.
The more confusing part is when I follow the advice to create further subkeys
, one for signature, one for encryption. Let's just call the original encryption subkey
ESK0
and the new encryption subkey
ESK1
, and the new signing subkey
SSK1
and the masterkey
MK
.
After creating ESK1
and SSK1
I should have in total 4 public/private key pairs, correct? Then, following the guides, I remove the MK
to an offline medium and remove it from my computer, thus I now have in my comoputer:
- A public/private pair
ESK0
(original encryption) - A public/private pair
ESK1
(new encryption) - A public/private pair
SSK1
(new signature) - A public key for
MK
I then change password using gpg --edit-key $id passwd
. According to some guides it should change the password to the subkeys, but I am not so sure about that, I think that this just changes password to the whole structure bounded to MK
it is just that the structure with private MK
stored offline has still the old password. Which is correct?
Now, if I sign something, which is the signing key? I believe it has to be SSK1
since MK
is no longer available. Correct?
I then upload some public key to a key server using gpg --send-key $id
. Which public key/keys have I uploaded?
If someone will use the information from the key server to send me some encrypted information, which public key will be use for the encryption - ESK0
or ESK1
? I am worried it would be ESK0
since then the whole point of having subkeys would be completely pointless as for decryption I would still be using ESK0
.
Also, why is it that the guides suggest removal of MK
but the ESK0
still is supposed to stay on the system? What is the purpose of ESK1
then?
Thank you for any help.