MCPcopy Create free account
hub / github.com/apache/httpd / _private_key

Function _private_key

test/pyhttpd/certs.py:25–43  ·  view source on GitHub ↗
(key_type)

Source from the content-addressed store, hash-verified

23
24
25def _private_key(key_type):
26 if isinstance(key_type, str):
27 key_type = key_type.upper()
28 m = re.match(r'^(RSA)?(\d+)$', key_type)
29 if m:
30 key_type = int(m.group(2))
31
32 if isinstance(key_type, int):
33 return rsa.generate_private_key(
34 public_exponent=65537,
35 key_size=key_type,
36 backend=default_backend()
37 )
38 if not isinstance(key_type, ec.EllipticCurve) and key_type in EC_SUPPORTED:
39 key_type = EC_SUPPORTED[key_type]
40 return ec.generate_private_key(
41 curve=key_type,
42 backend=default_backend()
43 )
44
45
46class CertificateSpec:

Callers 3

_make_ca_credentialsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected