[pycrypto] providing signature in base64

Cornelius Kölbel cornelius.koelbel at lsexperts.de
Wed May 9 10:28:30 EDT 2012


I have a signature provided in base64 like this:


but I am breaking my head how to pass this to the verify function.

I create the RSA Object from a PEM encoded public key. This works fine.

But when I try to unpack the base64 encoded signature, I do not get ONE
long but a tuple with 32 long int.

    long_signature= struct.unpack('Q'*32, sign.decode("base64"))
    hash = sha256(licStr).digest()
    RSAKey = RSA.importKey(public)
    ret =  RSAKey.verify(hash, long_signature)

I know that this is more a matter of how to handle the unpack function,
but did not find anything about this.

Thanks a lot and kind regards

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.dlitz.net/pipermail/pycrypto/attachments/20120509/cc4a977a/attachment.pgp>

More information about the pycrypto mailing list