{
 "action": "Not for automatic application — after the patch the example still uses PUBLIC_KEY_TYPES, which the verified example does not: the patch covers part of the change. Show this correction to the user as a lead. Replace the old line with the new one; the rest of the code can stay.",
 "alternatives": [],
 "applicability": {
  "leftover": [
   "PUBLIC_KEY_TYPES"
  ],
  "line": 11,
  "method": "literal_patch",
  "occurrences": 1,
  "patched_sha": "0bae06b62c77",
  "reason": "after the patch the example still uses PUBLIC_KEY_TYPES, which the verified example does not: the patch covers part of the change",
  "run_on": "50.0.2",
  "status": "incomplete"
 },
 "by_notes": true,
 "changelog_ref": {
  "quote": "Removed the deprecated ``PUBLIC_KEY_TYPES``, ``PRIVATE_KEY_TYPES``, ``CERTIFICATE_PRIVATE_KEY_TYPES``, ``CERTIFICATE_ISSUER_PUBLIC_KEY_TYPES``, and ``CERTIFICATE_PUBLIC_KEY_TYPES`` type aliases.",
  "url": "https://github.com/pyca/cryptography/blob/HEAD/CHANGELOG.rst"
 },
 "confirmations": {
  "failed": 0,
  "worked": 6
 },
 "detect": [
  "PUBLIC_KEY_TYPES"
 ],
 "ecosystem": "pypi",
 "equivalence": "same",
 "error_kind": "missing_import",
 "error_signature": {
  "message": "cannot import name 'PUBLIC_KEY_TYPES' from 'cryptography.hazmat.primitives.asymmetric.types' (/usr/local/lib/python3.11/site-packages/cryptography/hazmat/primitives/asymmetric/types.py)",
  "norm": "missing_import:public_key_types",
  "type": "ImportError"
 },
 "first_seen": "2026-10-20T16:11:13+00:00",
 "format": "replace",
 "format_version": 2,
 "id": "pypi/cryptography/50.0.2/0001",
 "kind": "removed",
 "license": "https://creativecommons.org/licenses/by/4.0/",
 "package": "cryptography",
 "proof": {
  "applicability": {
   "leftover": [
    "PUBLIC_KEY_TYPES"
   ],
   "line": 11,
   "method": "literal_patch",
   "occurrences": 1,
   "patched_sha": "0bae06b62c77",
   "reason": "after the patch the example still uses PUBLIC_KEY_TYPES, which the verified example does not: the patch covers part of the change",
   "run_on": "50.0.2",
   "status": "incomplete"
  },
  "auto_apply": false,
  "auto_apply_reason": "the patch gives incomplete when applied word for word",
  "auto_apply_rule": "Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own.",
  "equivalence": "same",
  "equivalent": true,
  "fails_on": "50.0.2",
  "fixed_on": "50.0.2",
  "level": "differential",
  "method": {
   "fix_on": "50.0.2",
   "name": "stdout_match",
   "normalization": "lines stripped, blank lines dropped, runs of whitespace collapsed; memory addresses, timestamps and temporary paths masked",
   "original_on": "46.0.6",
   "scope": "the observable stdout of one example script; return values, files, other inputs and exception types are not compared, so a match is not a proof of equivalent behaviour"
  },
  "script_right": "from cryptography.hazmat.primitives.asymmetric import (\n    dh,\n    dsa,\n    ec,\n    ed448,\n    ed25519,\n    rsa,\n    x448,\n    x25519,\n)\nfrom cryptography.hazmat.primitives.asymmetric.types import PublicKeyTypes\n\n\ndef describe_public_key(key: PublicKeyTypes) -> str:\n    \"\"\"Return a short human-readable label describing a public key.\"\"\"\n    if isinstance(key, rsa.RSAPublicKey):\n        return f\"RSA-{key.key_size}\"\n    elif isinstance(key, ec.EllipticCurvePublicKey):\n        return f\"EC-{key.curve.name}\"\n    elif isinstance(key, ed25519.Ed25519PublicKey):\n        return \"Ed25519\"\n    elif isinstance(key, ed448.Ed448PublicKey):\n        return \"Ed448\"\n    elif isinstance(key, x25519.X25519PublicKey):\n        return \"X25519\"\n    elif isinstance(key, x448.X448PublicKey):\n        return \"X448\"\n    elif isinstance(key, dsa.DSAPublicKey):\n        return f\"DSA-{key.key_size}\"\n    elif isinstance(key, dh.DHPublicKey):\n        return f\"DH-{key.key_size}\"\n    else:\n        raise TypeError(f\"Unsupported key type: {type(key).__name__}\")\n\n\ndef main() -> None:\n    # 1. RSA key pair\n    rsa_private = rsa.generate_private_key(public_exponent=65537, key_size=2048)\n    rsa_public = rsa_private.public_key()\n    print(\"RSA Public Key:    \", describe_public_key(rsa_public))\n\n    # 2. Elliptic Curve (EC) key pair\n    ec_private = ec.generate_private_key(ec.SECP256R1())\n    ec_public = ec_private.public_key()\n    print(\"EC Public Key:     \", describe_public_key(ec_public))\n\n    # 3. Ed25519 key pair\n    ed25519_private = ed25519.Ed25519PrivateKey.generate()\n    ed25519_public = ed25519_private.public_key()\n    print(\"Ed25519 Public Key:\", describe_public_key(ed25519_public))\n\n\nif __name__ == \"__main__\":\n    main()",
  "script_wrong": "from cryptography.hazmat.primitives.asymmetric import (\n    dh,\n    dsa,\n    ec,\n    ed448,\n    ed25519,\n    rsa,\n    x448,\n    x25519,\n)\nfrom cryptography.hazmat.primitives.asymmetric.types import PUBLIC_KEY_TYPES\n\n\ndef describe_public_key(key: PUBLIC_KEY_TYPES) -> str:\n    \"\"\"Return a short human-readable label describing a public key.\"\"\"\n    if isinstance(key, rsa.RSAPublicKey):\n        return f\"RSA-{key.key_size}\"\n    elif isinstance(key, ec.EllipticCurvePublicKey):\n        return f\"EC-{key.curve.name}\"\n    elif isinstance(key, ed25519.Ed25519PublicKey):\n        return \"Ed25519\"\n    elif isinstance(key, ed448.Ed448PublicKey):\n        return \"Ed448\"\n    elif isinstance(key, x25519.X25519PublicKey):\n        return \"X25519\"\n    elif isinstance(key, x448.X448PublicKey):\n        return \"X448\"\n    elif isinstance(key, dsa.DSAPublicKey):\n        return f\"DSA-{key.key_size}\"\n    elif isinstance(key, dh.DHPublicKey):\n        return f\"DH-{key.key_size}\"\n    else:\n        raise TypeError(f\"Unsupported key type: {type(key).__name__}\")\n\n\ndef main() -> None:\n    # 1. RSA key pair\n    rsa_private = rsa.generate_private_key(public_exponent=65537, key_size=2048)\n    rsa_public = rsa_private.public_key()\n    print(\"RSA Public Key:    \", describe_public_key(rsa_public))\n\n    # 2. Elliptic Curve (EC) key pair\n    ec_private = ec.generate_private_key(ec.SECP256R1())\n    ec_public = ec_private.public_key()\n    print(\"EC Public Key:     \", describe_public_key(ec_public))\n\n    # 3. Ed25519 key pair\n    ed25519_private = ed25519.Ed25519PrivateKey.generate()\n    ed25519_public = ed25519_private.public_key()\n    print(\"Ed25519 Public Key:\", describe_public_key(ed25519_public))\n\n\nif __name__ == \"__main__\":\n    main()",
  "works_on": "46.0.6"
 },
 "right": "from cryptography.hazmat.primitives.asymmetric.types import PublicKeyTypes",
 "seen_in_models": [
  "gemini-3.8-flash",
  "gpt-6.1-sol"
 ],
 "seq": 1,
 "slug": "public-key-types",
 "source": "pipeline",
 "symbol": "PUBLIC_KEY_TYPES",
 "updated": "2026-10-27T17:20:00+00:00",
 "url": "https://formachines.ai/errata/pypi/cryptography/0001-public-key-types/",
 "variant_confirmations": 6,
 "variant_models": [
  "gemini-3.8-flash",
  "gpt-6.1-sol"
 ],
 "verified": "sandbox",
 "versions": {
  "changed_in": ">46.0.6,<=50.0.2",
  "fails_on": "50.0.2",
  "works_on": "46.0.6"
 },
 "wrong": "from cryptography.hazmat.primitives.asymmetric.types import PUBLIC_KEY_TYPES"
}