Skip to content

Commit d129af2

Browse files
authored
Deprecate sign() and verify() (#1256)
1 parent 8bfe5df commit d129af2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Deprecations:
2424
- Deprecated ``OpenSSL.crypto.CRL``
2525
- Deprecated ``OpenSSL.crypto.Revoked``
2626
- Deprecated ``OpenSSL.crypto.load_crl`` and ``OpenSSL.crypto.dump_crl``
27+
- Deprecated ``OpenSSL.crypto.sign`` and ``OpenSSL.crypto.verify``
2728

2829
Changes:
2930
^^^^^^^^

src/OpenSSL/crypto.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3149,6 +3149,15 @@ def sign(pkey: PKey, data: Union[str, bytes], digest: str) -> bytes:
31493149
return _ffi.buffer(signature_buffer, signature_length[0])[:]
31503150

31513151

3152+
utils.deprecated(
3153+
sign,
3154+
__name__,
3155+
"sign() is deprecated. Use the equivilant APIs in cryptography.",
3156+
DeprecationWarning,
3157+
name="sign",
3158+
)
3159+
3160+
31523161
def verify(
31533162
cert: X509, signature: bytes, data: Union[str, bytes], digest: str
31543163
) -> None:
@@ -3187,6 +3196,15 @@ def verify(
31873196
_raise_current_error()
31883197

31893198

3199+
utils.deprecated(
3200+
verify,
3201+
__name__,
3202+
"verify() is deprecated. Use the equivilant APIs in cryptography.",
3203+
DeprecationWarning,
3204+
name="verify",
3205+
)
3206+
3207+
31903208
def dump_crl(type: int, crl: CRL) -> bytes:
31913209
"""
31923210
Dump a certificate revocation list to a buffer.

0 commit comments

Comments
 (0)