'Verify that a certain PKCS#1 PSS signature is authentic.
This function checks if the party holding the private half of the given
RSA key has really signed the message.
This function is called ``RSASSA-PSS-VERIFY``, and is specified in section
8.1.2 of RFC3447.
:Parameters:
mhash : hash object
The hash that was carried out over the message. This is an object
belonging to the `Crypto.Hash` module.
S : string
The signature that needs to be validated.
:Return: True if verification is correct. False otherwise.'

def verify(self, mhash, S):

    if (self._saltLen == None):
        sLen = mhash.digest_size
    else:
        sLen = self._saltLen
    if self._mgfunc:
        mgf = self._mgfunc
    else:
        mgf = (lambda x, y: MGF1(x, y, mhash))
    modBits = Crypto.Util.number.size(self._key.n)
    k = ceil_div(modBits, 8)
    if (len(S) != k):
        return False
    em = self._key.encrypt(S, 0)[0]
    emLen = ceil_div((modBits - 1), 8)
    em = ((bchr(0) * (emLen - len(em))) + em)
    try:
        result = EMSA_PSS_VERIFY(mhash, em, (modBits - 1), mgf, sLen)
    except ValueError:
        return False
    return result
