Closed Liam-Rougoor closed 1 year ago
This is looking good. Do we also want to extend it to setting the preferred signing and verification keys?
This is looking good. Do we also want to extend it to setting the preferred signing and verification keys?
That sounds like a good idea. Perhaps something we could implement in a separate PR?
Sure, happy for this to be done in a separate PR.
238 (partly)
So, I've changed how public keys are managed in
EncryptionKeys
and how they are used in Encryption and some Verification inPGP
.Summary of the main changes in this PR:
PgpPublicKeyRingWithPreferredKey
(I'm still open for better name suggestions). This class stores the public key ring, the default key (using the already existing algorithm to find the 'best' key) and a preferred key, which can be set by the user usingEncryptionKeys.UseEncryptionKey(_some_keyId_)
I think more improvements can be made regarding the handling of public keys, but I think this PR could give an indication of a possible direction.