MCPcopy Create free account
hub / github.com/SecurityInnovation/PGPy / _get_key_flags

Method _get_key_flags

pgpy/pgp.py:1901–1915  ·  view source on GitHub ↗
(self, user=None)

Source from the content-addressed store, hash-verified

1899 key |= bsig
1900
1901 def _get_key_flags(self, user=None):
1902 if self.is_primary:
1903 if user is not None:
1904 user = self.get_uid(user)
1905
1906 elif len(self._uids) == 0:
1907 return {KeyFlags.Certify}
1908
1909 else:
1910 user = next(iter(self.userids))
1911
1912 # RFC 4880 says that primary keys *must* be capable of certification
1913 return {KeyFlags.Certify} | (user.selfsig.key_flags if user.selfsig else set())
1914
1915 return next(self.self_signatures).key_flags
1916
1917 def _sign(self, subject, sig, **prefs):
1918 """

Callers 1

usageMethod · 0.80

Calls 1

get_uidMethod · 0.95

Tested by

no test coverage detected