Skip to content

Commit 5b05f47

Browse files
committed
Allow creation and use of v4 keys without a User ID (with warning)
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.
1 parent e1d3c24 commit 5b05f47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pgpy/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _action(key, *args, **kwargs):
119119
if len(key._uids) == 0 and key.is_primary and key._key.__ver__ < 6:
120120
# if a key is in the process of being created, it needs to be allowed to certify its own user id
121121
if action is not key.certify.__wrapped__:
122-
raise PGPError("Key is not complete - please add a User ID!")
122+
logging.warning("Version 4 Key has no User ID -- may be incompatible with some legacy OpenPGP implementations.")
123123

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

0 commit comments

Comments
 (0)