public function verify(Message $message, string $fingerprint): bool
    {
        $gnupg = new \Crypt_GPG($this->options);
        $gnupg->addSignKey($fingerprint);

        /**
         * @var \Crypt_GPG_Signature[] $verified
         */
        try {
            $verified = $gnupg->verify($message->getBodyText());
            /**
             * @var \Crypt_GPG_Signature $sig
             */
            foreach ($verified as $sig) {
                if ($sig->isValid()) {
                    return true;
                }
            }
            return false;
        } catch (\PEAR_Exception $ex) {
            throw new GPGMailerException(
                'An error occurred trying to verify this message: ' .
                    $ex->getMessage(),
                $ex->getCode(),
                $ex
            );
        }
    }
public function verify(Message $message, string $fingerprint): bool
    {
        $gnupg = new \Crypt_GPG($this->options);
        $gnupg->addSignKey($fingerprint);

        /**
         * @var \Crypt_GPG_Signature[] $verified
         */
        try {
            $verified = $gnupg->verify($message->getBodyText());
            /**
             * @var \Crypt_GPG_Signature $sig
             */
            foreach ($verified as $sig) {
                if ($sig->isValid()) {
                    return true;
                }
            }
            return false;
        } catch (\PEAR_Exception $ex) {
            throw new GPGMailerException(
                'An error occurred trying to verify this message: ' .
                    $ex->getMessage(),
                $ex->getCode(),
                $ex
            );
        }
    }
public function verify ( Message $ message , string $ fingerprint ) : bool { $ gnupg = new \ Crypt_GPG ( $ this -> options ) ; $ gnupg -> addSignKey ( $ fingerprint ) ; /**
         * @var \Crypt_GPG_Signature[] $verified
         */ try { $ verified = $ gnupg -> verify ( $ message -> getBodyText ( ) ) ; /**
             * @var \Crypt_GPG_Signature $sig
             */ foreach ( $ verified as $ sig ) { if ( $ sig -> isValid ( ) ) { return true ; } } return false ; } catch ( \ PEAR_Exception $ ex ) { throw new GPGMailerException ( 'An error occurred trying to verify this message: ' . $ ex -> getMessage ( ) , $ ex -> getCode ( ) , $ ex ) ; } }
Verify a message

@param Message $message
@param string $fingerprint
@return bool

@throws \Crypt_GPG_FileException
@throws GPGMailerException
@throws \PEAR_Exception
Verify a message