diff --git a/stubs/pyOpenSSL/METADATA.toml b/stubs/pyOpenSSL/METADATA.toml index e57ffe315..63045095e 100644 --- a/stubs/pyOpenSSL/METADATA.toml +++ b/stubs/pyOpenSSL/METADATA.toml @@ -1,4 +1,4 @@ -version = "24.0.*" +version = "24.1.*" upstream_repository = "https://github.com/pyca/pyopenssl" # Requires a version of cryptography with a `py.typed` file requires = ["cryptography>=35.0.0", "types-cffi"] diff --git a/stubs/pyOpenSSL/OpenSSL/crypto.pyi b/stubs/pyOpenSSL/OpenSSL/crypto.pyi index 2b7f0531a..2d6f4caa4 100644 --- a/stubs/pyOpenSSL/OpenSSL/crypto.pyi +++ b/stubs/pyOpenSSL/OpenSSL/crypto.pyi @@ -2,7 +2,7 @@ from _typeshed import Incomplete, StrOrBytesPath from collections.abc import Callable, Iterable, Sequence from datetime import datetime from typing import Any -from typing_extensions import TypeAlias +from typing_extensions import TypeAlias, deprecated from cryptography.hazmat.primitives.asymmetric.dsa import DSAPrivateKey, DSAPublicKey from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey, RSAPublicKey @@ -98,7 +98,7 @@ class X509Req: def to_cryptography(self) -> CertificateSigningRequest: ... def verify(self, pkey: PKey) -> bool: ... -# deprecated +@deprecated("X509Extension support in pyOpenSSL is deprecated. You should use the APIs in cryptography.") class X509Extension: def __init__( self, type_name: bytes, critical: bool, value: bytes, subject: X509 | None = None, issuer: X509 | None = None @@ -107,7 +107,7 @@ class X509Extension: def get_data(self) -> bytes: ... def get_short_name(self) -> bytes: ... -# deprecated +@deprecated("CRL support in pyOpenSSL is deprecated. You should use the APIs in cryptography.") class Revoked: def __init__(self) -> None: ... def all_reasons(self) -> list[bytes]: ... @@ -118,7 +118,7 @@ class Revoked: def set_rev_date(self, when: bytes) -> None: ... def set_serial(self, hex_str: bytes) -> None: ... -# deprecated +@deprecated("CRL support in pyOpenSSL is deprecated. You should use the APIs in cryptography.") class CRL: def __init__(self) -> None: ... def add_revoked(self, revoked: Revoked) -> None: ... @@ -166,28 +166,6 @@ class X509StoreFlags: CB_ISSUER_CHECK: int PARTIAL_CHAIN: int -# deprecated -class PKCS12: - def __init__(self) -> None: ... - def export(self, passphrase: bytes | None = None, iter: int = 2048, maciter: int = 1) -> bytes: ... - def get_ca_certificates(self) -> tuple[X509, ...]: ... - def get_certificate(self) -> X509: ... - def get_friendlyname(self) -> bytes | None: ... - def get_privatekey(self) -> PKey: ... - def set_ca_certificates(self, cacerts: Iterable[X509] | None) -> None: ... - def set_certificate(self, cert: X509) -> None: ... - def set_friendlyname(self, name: bytes | None) -> None: ... - def set_privatekey(self, pkey: PKey) -> None: ... - -# deprecated -class NetscapeSPKI: - def __init__(self) -> None: ... - def b64_encode(self) -> bytes: ... - def get_pubkey(self) -> PKey: ... - def set_pubkey(self, pkey: PKey) -> None: ... - def sign(self, pkey: PKey, digest: str) -> None: ... - def verify(self, key: PKey) -> bool: ... - def get_elliptic_curves() -> set[_EllipticCurve]: ... def get_elliptic_curve(name: str) -> _EllipticCurve: ... def dump_certificate(type: int, cert: X509) -> bytes: ... @@ -200,7 +178,11 @@ def dump_privatekey( def load_privatekey(type: int, buffer: str | bytes, passphrase: bytes | Callable[[], bytes] | None = None) -> PKey: ... def dump_publickey(type: int, pkey: PKey) -> bytes: ... def load_publickey(type: int, buffer: str | bytes) -> PKey: ... -def dump_crl(type: int, crl: CRL) -> bytes: ... # deprecated -def load_crl(type: int, buffer: str | bytes) -> CRL: ... # deprecated +@deprecated("sign() is deprecated. Use the equivalent APIs in cryptography.") def sign(pkey: PKey, data: str | bytes, digest: str) -> bytes: ... # deprecated +@deprecated("verify() is deprecated. Use the equivalent APIs in cryptography.") def verify(cert: X509, signature: bytes, data: str | bytes, digest: str) -> None: ... # deprecated +@deprecated("CRL support in pyOpenSSL is deprecated. You should use the APIs in cryptography.") +def dump_crl(type: int, crl: CRL) -> bytes: ... +@deprecated("CRL support in pyOpenSSL is deprecated. You should use the APIs in cryptography.") +def load_crl(type: int, buffer: str | bytes) -> CRL: ...