Ejemplo n.º 1
0
 def test_ne(self, backend):
     sct1 = (_load_data(
         os.path.join("x509", "ocsp", "resp-sct-extension.der"),
         ocsp.load_der_ocsp_response,
     ).single_extensions.get_extension_for_class(
         x509.SignedCertificateTimestamps).value)
     sct2 = x509.SignedCertificateTimestamps([])
     assert sct1 != sct2
     assert sct1 != object()
Ejemplo n.º 2
0
 def test_hash(self, backend):
     sct1 = _load_data(
         os.path.join("x509", "ocsp", "resp-sct-extension.der"),
         ocsp.load_der_ocsp_response,
     ).single_extensions.get_extension_for_class(
         x509.SignedCertificateTimestamps
     ).value
     sct2 = _load_data(
         os.path.join("x509", "ocsp", "resp-sct-extension.der"),
         ocsp.load_der_ocsp_response,
     ).single_extensions.get_extension_for_class(
         x509.SignedCertificateTimestamps
     ).value
     sct3 = x509.SignedCertificateTimestamps([])
     assert hash(sct1) == hash(sct2)
     assert hash(sct1) != hash(sct3)
Ejemplo n.º 3
0
 def test_repr(self):
     assert repr(x509.SignedCertificateTimestamps(
         [])) == ("<SignedCertificateTimestamps([])>")
Ejemplo n.º 4
0
 def test_init(self):
     with pytest.raises(TypeError):
         x509.SignedCertificateTimestamps([object()])
Ejemplo n.º 5
0
def _decode_signed_certificate_timestamps(backend, asn1_scts):
    return x509.SignedCertificateTimestamps(_decode_scts(backend, asn1_scts))
Ejemplo n.º 6
0
 def test_init(self):
     with pytest.raises(TypeError):
         x509.SignedCertificateTimestamps(
             [object()]  # type: ignore[list-item]
         )