Skip to content

Instantly share code, notes, and snippets.

@jag3773
Created January 29, 2015 19:49
Show Gist options
  • Save jag3773/fdc8ac433c41dcb19f84 to your computer and use it in GitHub Desktop.
Save jag3773/fdc8ac433c41dcb19f84 to your computer and use it in GitHub Desktop.
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
[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