From eb631c1d27178527dfce58df5d6d42dc997dfb5e Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 18 Aug 2023 12:17:26 -0400 Subject: [PATCH] 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. --- pgpy/decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgpy/decorators.py b/pgpy/decorators.py index 4d16ba93..1c454771 100644 --- a/pgpy/decorators.py +++ b/pgpy/decorators.py @@ -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)