Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: third_party/tlslite/tlslite/utils/keyfactory.py

Issue 211173006: Perform tlslite 0.3.8 -> 0.4.6 renames ahead of time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop the -B Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 """Factory functions for asymmetric cryptography. 1 """Factory functions for asymmetric cryptography.
2 @sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey, 2 @sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey,
3 parseAsPrivateKey 3 parseAsPrivateKey
4 """ 4 """
5 5
6 from compat import * 6 from compat import *
7 7
8 from RSAKey import RSAKey 8 from rsakey import RSAKey
9 from Python_RSAKey import Python_RSAKey 9 from python_rsakey import Python_RSAKey
10 import cryptomath 10 import cryptomath
11 11
12 if cryptomath.m2cryptoLoaded: 12 if cryptomath.m2cryptoLoaded:
13 from OpenSSL_RSAKey import OpenSSL_RSAKey 13 from openssl_rsakey import OpenSSL_RSAKey
14 14
15 if cryptomath.pycryptoLoaded: 15 if cryptomath.pycryptoLoaded:
16 from PyCrypto_RSAKey import PyCrypto_RSAKey 16 from pycrypto_rsakey import PyCrypto_RSAKey
17 17
18 # ************************************************************************** 18 # **************************************************************************
19 # Factory Functions for RSA Keys 19 # Factory Functions for RSA Keys
20 # ************************************************************************** 20 # **************************************************************************
21 21
22 def generateRSAKey(bits, implementations=["openssl", "python"]): 22 def generateRSAKey(bits, implementations=["openssl", "python"]):
23 """Generate an RSA key with the specified bit length. 23 """Generate an RSA key with the specified bit length.
24 24
25 @type bits: int 25 @type bits: int
26 @param bits: Desired bit length of the new key's modulus. 26 @param bits: Desired bit length of the new key's modulus.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 raise ValueError("No acceptable implementations") 234 raise ValueError("No acceptable implementations")
235 235
236 def _createPrivateRSAKey(n, e, d, p, q, dP, dQ, qInv, 236 def _createPrivateRSAKey(n, e, d, p, q, dP, dQ, qInv,
237 implementations = ["pycrypto", "python"]): 237 implementations = ["pycrypto", "python"]):
238 for implementation in implementations: 238 for implementation in implementations:
239 if implementation == "pycrypto" and cryptomath.pycryptoLoaded: 239 if implementation == "pycrypto" and cryptomath.pycryptoLoaded:
240 return PyCrypto_RSAKey(n, e, d, p, q, dP, dQ, qInv) 240 return PyCrypto_RSAKey(n, e, d, p, q, dP, dQ, qInv)
241 elif implementation == "python": 241 elif implementation == "python":
242 return Python_RSAKey(n, e, d, p, q, dP, dQ, qInv) 242 return Python_RSAKey(n, e, d, p, q, dP, dQ, qInv)
243 raise ValueError("No acceptable implementations") 243 raise ValueError("No acceptable implementations")
OLDNEW
« no previous file with comments | « third_party/tlslite/tlslite/utils/datefuncs.py ('k') | third_party/tlslite/tlslite/utils/openssl_aes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698