From 20f8f921613a0e7eb0321374535237165561a3f1 Mon Sep 17 00:00:00 2001 From: Giuseppe De Marco Date: Tue, 23 Jan 2024 23:41:31 +0100 Subject: [PATCH] fix: deps, cryptography breaking changes (#236) --- pyeudiw/sd_jwt/__init__.py | 6 +++--- setup.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyeudiw/sd_jwt/__init__.py b/pyeudiw/sd_jwt/__init__.py index 5059d29d..ab952934 100644 --- a/pyeudiw/sd_jwt/__init__.py +++ b/pyeudiw/sd_jwt/__init__.py @@ -24,7 +24,7 @@ from typing import Any from cryptojwt.jwk.rsa import RSAKey from cryptojwt.jwk.ec import ECKey -from cryptography.hazmat.backends.openssl.rsa import _RSAPrivateKey +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateKey class TrustChainSDJWTIssuer(SDJWTIssuer): @@ -152,7 +152,7 @@ def pk_encode_int(i: str, bit_size: int = None) -> str: return base64url_encode(unhexlify(extend * '0' + hexi)) -def import_pyca_pri_rsa(key: _RSAPrivateKey, **params) -> jwcrypto.jwk.JWK: +def import_pyca_pri_rsa(key: RSAPrivateKey, **params) -> jwcrypto.jwk.JWK: """ Import a private RSA key from a PyCA object. @@ -165,7 +165,7 @@ def import_pyca_pri_rsa(key: _RSAPrivateKey, **params) -> jwcrypto.jwk.JWK: :rtype: RSAKey """ - if not isinstance(key, _RSAPrivateKey): + if not isinstance(key, RSAPrivateKey): raise ValueError("key must be a ssl RSAPrivateKey object") pn = key.private_numbers() diff --git a/setup.py b/setup.py index 928dcd86..e218d356 100644 --- a/setup.py +++ b/setup.py @@ -51,8 +51,8 @@ def readme(): "satosa>=8.4,<8.6", "jinja2>=3.0,<4", "pymongo>=4.4.1,<4.5", - "requests>=2.2,<2.3", - "sd-jwt @ git+https://github.com/openwallet-foundation-labs/sd-jwt-python.git", + "requests>=2.2,<2.4", + "sd-jwt", ], "federation": [ "asyncio>=4,<4.1",