From 1071fde2f715c9564d19f4e5eee6a5910c2839b1 Mon Sep 17 00:00:00 2001 From: Ib Lundgren Date: Wed, 24 Sep 2014 17:24:14 +0100 Subject: Allow alternative crypto library cryptography. An alternative to PyCrypto is taking form and it would be nice to allow users to choose which library they prefer to use for their RSA signing. CC #226. --- oauthlib/common.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'oauthlib/common.py') diff --git a/oauthlib/common.py b/oauthlib/common.py index d3e2edb..01ca775 100644 --- a/oauthlib/common.py +++ b/oauthlib/common.py @@ -329,6 +329,11 @@ def to_unicode(data, encoding='UTF-8'): return data +def to_bytes(data, encoding='UTF-8'): + data = to_unicode(data, encoding=encoding) + return data.encode(encoding) + + class CaseInsensitiveDict(dict): """Basic case insensitive dict with strings only keys.""" -- cgit v1.2.1