コード例 #1
0
ファイル: test_ocsp.py プロジェクト: ventaquil/cryptography
 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()
コード例 #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)
コード例 #3
0
ファイル: test_ocsp.py プロジェクト: ventaquil/cryptography
 def test_repr(self):
     assert repr(x509.SignedCertificateTimestamps(
         [])) == ("<SignedCertificateTimestamps([])>")
コード例 #4
0
ファイル: test_ocsp.py プロジェクト: ventaquil/cryptography
 def test_init(self):
     with pytest.raises(TypeError):
         x509.SignedCertificateTimestamps([object()])
コード例 #5
0
def _decode_signed_certificate_timestamps(backend, asn1_scts):
    return x509.SignedCertificateTimestamps(_decode_scts(backend, asn1_scts))
コード例 #6
0
ファイル: test_ocsp.py プロジェクト: mr-chanil/cryptography
 def test_init(self):
     with pytest.raises(TypeError):
         x509.SignedCertificateTimestamps(
             [object()]  # type: ignore[list-item]
         )