MCPcopy
hub / github.com/pyca/cryptography / test_sign_ec_with_md5

Method test_sign_ec_with_md5

tests/x509/test_x509.py:3552–3573  ·  tests/x509/test_x509.py::TestCertificateBuilder.test_sign_ec_with_md5
(self, backend)

Source from the content-addressed store, hash-verified

3550 skip_message=class="st">"Requires OpenSSL with MD5 support",
3551 )
3552 def test_sign_ec_with_md5(self, backend):
3553 _skip_curve_unsupported(backend, ec.SECP256R1())
3554 private_key = EC_KEY_SECP256R1.private_key(backend)
3555 builder = x509.CertificateBuilder()
3556 builder = (
3557 builder.subject_name(
3558 x509.Name([x509.NameAttribute(NameOID.COUNTRY_NAME, class="st">"US")])
3559 )
3560 .issuer_name(
3561 x509.Name([x509.NameAttribute(NameOID.COUNTRY_NAME, class="st">"US")])
3562 )
3563 .serial_number(1)
3564 .public_key(private_key.public_key())
3565 .not_valid_before(datetime.datetime(2002, 1, 1, 12, 1))
3566 .not_valid_after(datetime.datetime(2032, 1, 1, 12, 1))
3567 )
3568 with pytest.raises(UnsupportedAlgorithm):
3569 builder.sign(
3570 private_key,
3571 hashes.MD5(), class="cm"># type: ignore[arg-type]
3572 backend,
3573 )
3574
3575 @pytest.mark.supported(
3576 only_if=lambda backend: backend.dsa_supported(),

Callers

nothing calls this directly

Calls 8

subject_nameMethod · 0.95
signMethod · 0.95
not_valid_afterMethod · 0.80
not_valid_beforeMethod · 0.80
_skip_curve_unsupportedFunction · 0.50
public_keyMethod · 0.45
serial_numberMethod · 0.45
issuer_nameMethod · 0.45

Tested by

no test coverage detected