rename function and add sanity-checking assertion

This commit is contained in:
Seth Schoen 2012-08-09 23:38:46 -07:00
parent 7e4069f691
commit 6dcf213ff6

View file

@ -4,10 +4,11 @@
from M2Crypto import EVP, X509, RSA
def mkreq(names, bits=2048):
def make_request(names, bits=2048):
"""Return a tuple (key, csr) containing a PEM-formatted private key
of the specified number of bits and a CSR requesting a certificate for
the specified DNS names."""
assert names, "Must provide one or more hostnames."
pk = EVP.PKey()
x = X509.Request()
rsa = RSA.gen_key(bits, 65537)