def chunks(s, n):
    for start in range(0, len(s), n):
        yield s[start:start + n]

def pem_format(key):
    return '\n'.join(['-----BEGIN PUBLIC KEY-----', '\n'.join(chunks(key, 
        64)), '-----END PUBLIC KEY-----'])

def validate_purchase(publicKey, signedData, signature):
    key = RSA.importKey(pem_format(publicKey))
verifier = PKCS1_v1_5.new(key)
data = SHA.new(signedData)
sig = b64decode(signature)
return verifier.verify(data, sig)
Проверка подписи в сообщении о покупке в приложении для Android в Python на Google App Engine