code: def verify(self, msg, signature, key):
          
          try:
              key.verify(signature, msg,
                         padding.PSS(mgf=padding.MGF1(self.hash_algorithm()),
                                     salt_length=padding.PSS.MAX_LENGTH),
                         self.hash_algorithm())
          except InvalidSignature as err:
              raise BadSignature(err)
          else:
              return True
docs: Verify a message signature
  
          :param msg: The message
          :param sig: A signature
          :param key: A ec.EllipticCurvePublicKey to use for the verification.
          :raises: BadSignature if the signature can't be verified.
          :return: True