Last active
February 8, 2018 06:02
-
-
Save hummus/29bd7b93b76f3d5fdd660d2bb11aa1d9 to your computer and use it in GitHub Desktop.
jwt RS512 encode
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
echo '{"foo": true}' | python -c "from jwt.api_jws import PyJWS;from cryptography.hazmat.backends import default_backend;from cryptography.hazmat.primitives.serialization import load_pem_private_key; jws=PyJWS(); pk = load_pem_private_key(open('key.pem').read(), password=None, backend=default_backend()); import sys; msg = jws.encode(sys.stdin.read(), pk, algorithm='RS512'); print msg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment