(cls, cert_path=None, cryptography_obj=None)
| 899 | """ |
| 900 | |
| 901 | def __call__(cls, cert_path=None, cryptography_obj=None): |
| 902 | # This allows to import cryptography objects directly |
| 903 | if cryptography_obj is not None: |
| 904 | obj = _PKIObj( |
| 905 | "DER", |
| 906 | cryptography_obj.public_bytes( |
| 907 | encoding=serialization.Encoding.DER, |
| 908 | ), |
| 909 | ) |
| 910 | else: |
| 911 | # Load from file |
| 912 | obj = _PKIObjMaker.__call__(cls, cert_path, _MAX_CERT_SIZE, "CERTIFICATE") |
| 913 | obj.__class__ = Cert |
| 914 | obj.marker = "CERTIFICATE" |
| 915 | try: |
| 916 | cert = X509_Cert(obj._der) |
| 917 | except Exception: |
| 918 | if conf.debug_dissector: |
| 919 | raise |
| 920 | raise Exception("Unable to import certificate") |
| 921 | obj.import_from_asn1pkt(cert) |
| 922 | return obj |
| 923 | |
| 924 | |
| 925 | def _get_cert_sig_hashname(cert): |
nothing calls this directly
no test coverage detected