Skip to content

Instantly share code, notes, and snippets.

@jag3773
Created February 16, 2015 19:27
Show Gist options
  • Save jag3773/b46a54206d169cd5f086 to your computer and use it in GitHub Desktop.
Save jag3773/b46a54206d169cd5f086 to your computer and use it in GitHub Desktop.
Signing Session
import ecdsa
from ecdsa import SigningKey, VerifyingKey
sk = SigningKey.from_pem(open('uW-test-sk.pem', 'r').read())
payload = open('/var/www/vhosts/api.unfoldingword.org/httpdocs/obs/txt/1/en/obs-en.json', 'r').read()
sig_der = sk.sign_deterministic(payload, sigencode=ecdsa.util.sigencode_der)
f = open('/var/www/vhosts/api.unfoldingword.org/httpdocs/obs/txt/1/en/obs-en.der.sig', 'w')
f.write(sig_der)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment