diff options
author | jturmel <jturmel@gmail.com> | 2014-03-22 23:05:53 -0500 |
---|---|---|
committer | jturmel <jturmel@gmail.com> | 2014-03-22 23:05:53 -0500 |
commit | 14f687b7355df142ea76145dea53bcbe7d012fdc (patch) | |
tree | c26d88e999b4a7d8f3684d17500e084ba40b935f /oauthlib/common.py | |
parent | ab4fe12f1707fc070b0fffec17a4fc8005ef990a (diff) | |
download | oauthlib-14f687b7355df142ea76145dea53bcbe7d012fdc.tar.gz |
Move setup.py requirements
* Moved requires for cryptotoken changes so that you don't have to install
the dependencies if you aren't going to use cryptotokens
Diffstat (limited to 'oauthlib/common.py')
-rw-r--r-- | oauthlib/common.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/oauthlib/common.py b/oauthlib/common.py index 044ba43..831f9eb 100644 --- a/oauthlib/common.py +++ b/oauthlib/common.py @@ -9,10 +9,8 @@ This module provides data structures and utilities common to all implementations of OAuth. """ -import Crypto.PublicKey.RSA as RSA import collections import datetime -import jwt import logging import random import re @@ -238,6 +236,9 @@ def generate_token(length=30, chars=UNICODE_ASCII_CHARACTER_SET): def generate_crypto_token(private_pem, request): + import Crypto.PublicKey.RSA as RSA + import jwt + private_key = RSA.importKey(private_pem) now = datetime.datetime.utcnow() @@ -256,6 +257,9 @@ def generate_crypto_token(private_pem, request): def verify_crypto_token(private_pem, token): + import Crypto.PublicKey.RSA as RSA + import jwt + public_key = RSA.importKey(private_pem).publickey() try: |