'Verify that a certain PKCS#1 v1.5 signature is authentic.
This function checks if the party holding the private half of the key
really signed the message.
This function is named ``RSASSA-PKCS1-V1_5-VERIFY``, and is specified in
section 8.2.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):

    modBits = Crypto.Util.number.size(self._key.n)
    k = ceil_div(modBits, 8)
    if (len(S) != k):
        return 0
    m = self._key.encrypt(S, 0)[0]
    em1 = ((bchr(0) * (k - len(m))) + m)
    try:
        em2 = EMSA_PKCS1_V1_5_ENCODE(mhash, k)
    except ValueError:
        return 0
    return (em1 == em2)
