MCPcopy Create free account
hub / github.com/adobe/Marinus / __get_alternative_names

Method __get_alternative_names

python3_cron_scripts/libs3/X509Parser.py:539–555  ·  view source on GitHub ↗

Obtain subject alternative names from the Python cryptography extensions object.

(self, cert_object, extensions)

Source from the content-addressed store, hash-verified

537 cert_object["signature_algorithm"] = ""
538
539 def __get_alternative_names(self, cert_object, extensions):
540 """
541 Obtain subject alternative names from the Python cryptography extensions object.
542 """
543 cert_object["subject_dns_names"] = []
544 cert_object["subject_ip_addresses"] = []
545 try:
546 alt_names = extensions.get_extension_for_oid(
547 ExtensionOID.SUBJECT_ALTERNATIVE_NAME
548 )
549 new_names = alt_names.value.get_values_for_type(x509.DNSName)
550 cert_object["subject_dns_names"] = new_names
551 new_ips = alt_names.value.get_values_for_type(x509.IPAddress)
552 for ip in new_ips:
553 cert_object["subject_ip_addresses"].append(str(ip))
554 except ExtensionNotFound:
555 self._logger.debug("No alternative names")
556
557 def __get_key_usages(self, cert_object, extensions):
558 """

Callers 1

__get_extensionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected