From 4eed940a66ab438c1218dc5a26e2d1d6c946e11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Thu, 9 Feb 2017 17:02:02 +0000 Subject: [PATCH] Clean up PKCS#12 generation --- certidude/authority.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/certidude/authority.py b/certidude/authority.py index af029f3..d6538c5 100644 --- a/certidude/authority.py +++ b/certidude/authority.py @@ -235,19 +235,9 @@ def generate_pkcs12_bundle(common_name, key_size=4096, owner=None): ) csr = x509.CertificateSigningRequestBuilder().subject_name(x509.Name([ - x509.NameAttribute(k, v) for k, v in ( - (NameOID.COMMON_NAME, common_name), - ) if v + x509.NameAttribute(NameOID.COMMON_NAME, common_name) ])) - if owner: - click.echo("Setting e-mail to: %s" % owner.mail) - csr = csr.add_extension( - x509.SubjectAlternativeName([ - x509.RFC822Name(owner.mail) - ]), - critical=False) - # Sign CSR cert = sign(Request( csr.sign(key, hashes.SHA512(), default_backend()).public_bytes(serialization.Encoding.PEM)), overwrite=True)