diff --git a/tests/test_commands.py b/tests/test_commands.py index 2adcb34e0a42ffaadd56fe08675c77ddbf36fae4..11959686230cdb91c5d1073b82af7b6045ba13e4 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1433,3 +1433,15 @@ def test_renew_client_reads_csr_from_stdin(mock_read_input, sample_project_direc assert stored_csr_public_numbers == custom_csr_public_numbers assert certificate_public_numbers == custom_csr_public_numbers assert certificate.subject != key_with_csr.csr.subject + + +def test_server_uses_same_private_key_algorithm_and_parameters_as_issuer_when_generating_private_key(tmpdir): + + private_key_file = tmpdir.join('.gimmecert', 'server', 'myserver.key.pem') + + gimmecert.commands.init(io.StringIO(), io.StringIO(), tmpdir.strpath, tmpdir.basename, 1, ("rsa", 1024)) + gimmecert.commands.server(io.StringIO(), io.StringIO(), tmpdir.strpath, 'myserver', None, None) + + private_key = gimmecert.storage.read_private_key(private_key_file.strpath) + + assert private_key.key_size == 1024