Created
January 29, 2015 19:49
-
-
Save jag3773/fdc8ac433c41dcb19f84 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://api.unfoldingword.org/obs/txt/1/uW-test-vk.pem | |
wget https://api.unfoldingword.org/obs/txt/1/en/obs-en.sig | |
wget https://api.unfoldingword.org/obs/txt/1/en/obs-en.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[jesse@jesse crypt]$ python | |
Python 2.7.5 (default, Nov 3 2014, 14:26:24) | |
[GCC 4.8.3 20140911 (Red Hat 4.8.3-7)] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from ecdsa import VerifyingKey, BadSignatureError | |
>>> vk = VerifyingKey.from_pem(open("uW-test-vk.pem").read()) | |
>>> message = open("obs-en.json","rb").read() | |
>>> sig = open("obs-en.sig","rb").read() | |
>>> try: | |
... vk.verify(sig, message) | |
... print "good signature" | |
... except BadSignatureError: | |
... print "BAD SIGNATURE" | |
... | |
True | |
good signature |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment