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

Method create_credentials

test/modules/md/md_certs.py:250–271  ·  view source on GitHub ↗

Create a certificate signed by this CA for the given domains. :returns: the certificate and private key PEM file paths

(spec: CertificateSpec, issuer: Credentials, key_type: Any,
                           valid_from: timedelta = timedelta(days=-1),
                           valid_to: timedelta = timedelta(days=89),
                           )

Source from the content-addressed store, hash-verified

248
249 @staticmethod
250 def create_credentials(spec: CertificateSpec, issuer: Credentials, key_type: Any,
251 valid_from: timedelta = timedelta(days=-1),
252 valid_to: timedelta = timedelta(days=89),
253 ) -> Credentials:
254 """Create a certificate signed by this CA for the given domains.
255 :returns: the certificate and private key PEM file paths
256 """
257 if spec.domains and len(spec.domains):
258 creds = MDTestCA._make_server_credentials(name=spec.name, domains=spec.domains,
259 issuer=issuer, valid_from=valid_from,
260 valid_to=valid_to, key_type=key_type)
261 elif spec.client:
262 creds = MDTestCA._make_client_credentials(name=spec.name, issuer=issuer,
263 email=spec.email, valid_from=valid_from,
264 valid_to=valid_to, key_type=key_type)
265 elif spec.name:
266 creds = MDTestCA._make_ca_credentials(name=spec.name, issuer=issuer,
267 valid_from=valid_from, valid_to=valid_to,
268 key_type=key_type)
269 else:
270 raise Exception(f"unrecognized certificate specification: {spec}")
271 return creds
272
273 @staticmethod
274 def _make_x509_name(org_name: str = None, common_name: str = None, parent: x509.Name = None) -> x509.Name:

Callers 2

issue_certMethod · 0.45

Calls 3

_make_ca_credentialsMethod · 0.45

Tested by

no test coverage detected