MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / from_pem

Method from_pem

mitmproxy/certs.py:94–96  ·  view source on GitHub ↗
(cls, data: bytes)

Source from the content-addressed store, hash-verified

92
93 @classmethod
94 def from_pem(cls, data: bytes) -> "Cert":
95 cert = x509.load_pem_x509_certificate(data) # type: ignore
96 return cls(cert)
97
98 def to_pem(self) -> bytes:
99 return self._cert.public_bytes(serialization.Encoding.PEM)

Callers 15

test_simpleMethod · 0.80
test_convertMethod · 0.80
test_keyinfoMethod · 0.80
test_is_caMethod · 0.80
test_err_broken_sansMethod · 0.80
test_stateMethod · 0.80
test_extractFunction · 0.80
test_get_certMethod · 0.80
test_crl_substitutionMethod · 0.80

Calls

no outgoing calls

Tested by 12

test_simpleMethod · 0.64
test_convertMethod · 0.64
test_keyinfoMethod · 0.64
test_is_caMethod · 0.64
test_err_broken_sansMethod · 0.64
test_stateMethod · 0.64
test_extractFunction · 0.64
test_get_certMethod · 0.64
test_crl_substitutionMethod · 0.64