Skip to content

Commit

Permalink
Allow creation and use of v4 keys without a User ID (with warning)
Browse files Browse the repository at this point in the history
draft-ietf-openpgp-crypto-refresh-10 makes it clear that even v4
OpenPGP certificates MAY not have a user ID.

Keep a warning in place though, to encourage interoperability with
legacy v4 implementations.
  • Loading branch information
dkg committed Aug 18, 2023
1 parent cd387a8 commit 7317f47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pgpy/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _action(key, *args, **kwargs):
if len(key._uids) == 0 and key.is_primary and key._key.__ver__ < 6:
# if a key is in the process of being created, it needs to be allowed to certify its own user id
if action is not key.certify.__wrapped__:
raise PGPError("Key is not complete - please add a User ID!")
logging.warning("Version 4 Key has no User ID -- may be incompatible with some legacy OpenPGP implementations.")

with self.usage(key, kwargs.get('user', None)) as _key:
self.check_attributes(key)
Expand Down

0 comments on commit 7317f47

Please sign in to comment.