mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Add tests for make_key
This commit is contained in:
@@ -148,7 +148,7 @@ def csr_matches_pubkey(csr, privkey):
|
||||
def make_key(bits=CONFIG.RSA_KEY_SIZE):
|
||||
"""Generate PEM encoded RSA key.
|
||||
|
||||
:param int bits: Number of bits.
|
||||
:param int bits: Number of bits, at least 1024.
|
||||
|
||||
:returns: new RSA key in PEM form with specified number of bits
|
||||
:rtype: str
|
||||
|
||||
@@ -112,6 +112,14 @@ class CSRMatchesPubkeyTest(unittest.TestCase):
|
||||
self.assertFalse(self._call_testdata('csr.pem', RSA512_KEY))
|
||||
|
||||
|
||||
class MakeKeyTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.client.crypto_util.make_key."""
|
||||
|
||||
def test_it(self):
|
||||
from letsencrypt.client.crypto_util import make_key
|
||||
M2Crypto.RSA.load_key_string(make_key(1024))
|
||||
|
||||
|
||||
class ValidPrivkeyTest(unittest.TestCase):
|
||||
"""Tests for letsencrypt.client.crypto_util.valid_privkey."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user