def _extract_matching_uid(key: PGPKey, uid: str) -> Optional[PGPKey]: # pylint: disable=protected-access for key_uid in key.userids: # todo filter for uids that have not been certified yet if uid_as_str(key_uid) == uid: key = copy(key) key = key.pubkey self_sig = key_uid.selfsig key_uid._signatures = SorteDeque() key_uid |= self_sig key._uids = SorteDeque() key._uids.insort(key_uid) return key return None
def strip_uids(key: PGPKey) -> None: # pylint: disable=protected-access key._uids = SorteDeque()