Skip to content

"ExtensionType" has no attribute "get_values_for_type" #13548

@mimi89999

Description

@mimi89999

Hello,

I used the example from https://cryptography.io/en/latest/x509/reference/#cryptography.x509.SubjectAlternativeName.get_values_for_type:

from cryptography import x509
from cryptography.x509.oid import ExtensionOID

cert = x509.load_pem_x509_certificate(b"")
san_ext = cert.extensions.get_extension_for_oid(ExtensionOID.SUBJECT_ALTERNATIVE_NAME)
san_names = san_ext.value.get_values_for_type(x509.DNSName)

print(san_names)

When I run mypy on it, I'm getting the following error:
error: "ExtensionType" has no attribute "get_values_for_type" [attr-defined]

Versions:

cryptography==46.0.2
mypy==1.18.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalewaiting-on-reporterIssue is waiting on a reply from the reporter. It will be automatically cloesd if there is no reply.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions