From 314dea3f5a17b7b1ef93a63ffcd45f7088cd04d2 Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Mon, 9 Feb 2015 12:05:59 -0800 Subject: [PATCH] Change Key to le_util.Key --- letsencrypt/client/client.py | 3 +-- letsencrypt/client/tests/apache/configurator_test.py | 4 ++-- letsencrypt/client/tests/apache/dvsni_test.py | 4 ++-- letsencrypt/scripts/main.py | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/letsencrypt/client/client.py b/letsencrypt/client/client.py index 4abfeb0c9..c9fa1dbb5 100644 --- a/letsencrypt/client/client.py +++ b/letsencrypt/client/client.py @@ -22,7 +22,6 @@ from letsencrypt.client import reverter from letsencrypt.client import revoker from letsencrypt.client.apache import configurator -from letsencrypt.client.le_util import Key class Client(object): @@ -365,7 +364,7 @@ def init_key(key_size): logging.info("Generating key (%d bits): %s", key_size, key_filename) - return Key(key_filename, key_pem) + return le_util.Key(key_filename, key_pem) def init_csr(privkey, names): diff --git a/letsencrypt/client/tests/apache/configurator_test.py b/letsencrypt/client/tests/apache/configurator_test.py index f8c983c31..9ed56f89d 100644 --- a/letsencrypt/client/tests/apache/configurator_test.py +++ b/letsencrypt/client/tests/apache/configurator_test.py @@ -8,13 +8,13 @@ import mock from letsencrypt.client import challenge_util from letsencrypt.client import errors +from letsencrypt.client import le_util from letsencrypt.client.apache import configurator from letsencrypt.client.apache import obj from letsencrypt.client.apache import parser from letsencrypt.client.tests.apache import util -from letsencrypt.client.le_util import Key class TwoVhost80Test(util.ApacheTest): @@ -164,7 +164,7 @@ class TwoVhost80Test(util.ApacheTest): def test_perform(self, mock_restart, mock_dvsni_perform): # Only tests functionality specific to configurator.perform # Note: As more challenges are offered this will have to be expanded - auth_key = Key(self.rsa256_file, self.rsa256_pem) + auth_key = le_util.Key(self.rsa256_file, self.rsa256_pem) chall1 = challenge_util.DvsniChall( "encryption-example.demo", "jIq_Xy1mXGN37tb4L6Xj_es58fW571ZNyXekdZzhh7Q", diff --git a/letsencrypt/client/tests/apache/dvsni_test.py b/letsencrypt/client/tests/apache/dvsni_test.py index d09cc56e2..c5b49dc67 100644 --- a/letsencrypt/client/tests/apache/dvsni_test.py +++ b/letsencrypt/client/tests/apache/dvsni_test.py @@ -7,9 +7,9 @@ import mock from letsencrypt.client import challenge_util from letsencrypt.client import CONFIG +from letsencrypt.client import le_util from letsencrypt.client.tests.apache import util -from letsencrypt.client.le_util import Key class DvsniPerformTest(util.ApacheTest): """Test the ApacheDVSNI challenge.""" @@ -32,7 +32,7 @@ class DvsniPerformTest(util.ApacheTest): rsa256_pem = pkg_resources.resource_string( "letsencrypt.client.tests", 'testdata/rsa256_key.pem') - auth_key = Key(rsa256_file, rsa256_pem) + auth_key = le_util.Key(rsa256_file, rsa256_pem) self.challs = [] self.challs.append(challenge_util.DvsniChall( "encryption-example.demo", diff --git a/letsencrypt/scripts/main.py b/letsencrypt/scripts/main.py index 7507b0620..e659432e1 100755 --- a/letsencrypt/scripts/main.py +++ b/letsencrypt/scripts/main.py @@ -18,8 +18,8 @@ from letsencrypt.client import client from letsencrypt.client import display from letsencrypt.client import errors from letsencrypt.client import interfaces +from letsencrypt.client import le_util from letsencrypt.client import log -from letsencrypt.client.le_util import Key def main(): # pylint: disable=too-many-statements,too-many-branches @@ -119,7 +119,7 @@ def main(): # pylint: disable=too-many-statements,too-many-branches if args.privkey is None: privkey = client.init_key(args.key_size) else: - privkey = Key(args.privkey[0], args.privkey[1]) + privkey = le_util.Key(args.privkey[0], args.privkey[1]) acme = client.Client(args.server, privkey, auth, installer)