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

Method verify

pgpy/packet/fields.py:622–632  ·  view source on GitHub ↗
(self, subj, sigbytes, hash_alg)

Source from the content-addressed store, hash-verified

620 return pkt
621
622 def verify(self, subj, sigbytes, hash_alg):
623 # GnuPG requires a pre-hashing with EdDSA
624 # https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-06#section-14.8
625 digest = hashes.Hash(hash_alg, backend=default_backend())
626 digest.update(subj)
627 subj = digest.finalize()
628 try:
629 self.__pubkey__().verify(sigbytes, subj)
630 except InvalidSignature:
631 return False
632 return True
633
634 def parse(self, packet):
635 oidlen = packet[0]

Callers

nothing calls this directly

Calls 3

__pubkey__Method · 0.95
updateMethod · 0.80
verifyMethod · 0.45

Tested by

no test coverage detected