Allow algorithm names to be upper- or lower-case
The standard doesn't seem to specify whether algorithm names must be capitalized or lower-case. I had an issue with spurious failures due to a lower-case algorithm name ("hs256"), so here is a patch that converts the incoming name to capital letters before looking it up in the algorithm dictionary.
Added support for custom headers in encode method
Update bin/jwt file to be Python 3 compatible.
Only tested on Python 2.7.5 and Python 3.3.3 to generate and verify tokens.
I added two features for convenience: 1) datetime conversion for 'iat' and 'nbf' as well. Previously 'exp' was the only thing supported. These two claims are the two standard claims also in time format (http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#issDef). 2) key value for RS* algorithms are converted automatically from a PEM string. I don't want to fuss around with the details like format conversions, importing packages, etc. Since Crypto packages is already imported and handled internally, it appears a good idea to have them handle the key conversion as well.
readme reformatting and edits
refactor decode(), fix setup.py for automated sdist builds
* split decode() internals into load() and verify_signature() * pull code out of read() function in setup.py so it doesn't fail when using distutils.core.run_setup() to build an archive * the setup.py change also uses with so file closing is automatic
Make PyCrypto optional if you're not using any of the RSASSA-PKCS1-v1_5 algorithms