It seems that issuers and/or holders with RSA key pairs doesn't work. Processing fails with the following traceback:
Traceback (most recent call last):
File "/sd-jwt-python/venv/bin/sd-jwt-generate", line 8, in <module>
sys.exit(run())
^^^^^
File "/sd-jwt-python/venv/lib/python3.12/site-packages/sd_jwt/bin/generate.py", line 275, in run
generate_test_case_data(settings, case_path, args.type)
File "/sd-jwt-python/venv/lib/python3.12/site-packages/sd_jwt/bin/generate.py", line 56, in generate_test_case_data
sdjwt_at_issuer = SDJWTIssuer(
^^^^^^^^^^^^
File "/sd-jwt-python/venv/lib/python3.12/site-packages/sd_jwt/issuer.py", line 55, in __init__
self._create_signed_jws()
File "/sd-jwt-python/venv/lib/python3.12/site-packages/sd_jwt/issuer.py", line 178, in _create_signed_jws
self.sd_jwt.add_signature(
File "/sd-jwt-python/venv/lib/python3.12/site-packages/jwcrypto/jws.py", line 545, in add_signature
sig = c.sign()
^^^^^^^^
File "/sd-jwt-python/venv/lib/python3.12/site-packages/jwcrypto/jws.py", line 152, in sign
signature = self.engine.sign(self.key, sigin)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/sd-jwt-python/venv/lib/python3.12/site-packages/jwcrypto/jwa.py", line 152, in sign
signature = skey.sign(payload, ec.ECDSA(self.hashfn))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RSAPrivateKey.sign() missing 1 required positional argument: 'algorithm'
jwa.py:152 is inside the the "_RawEC" constructor, so ... somehow, the wrong default key type is being used.
It seems that issuers and/or holders with RSA key pairs doesn't work. Processing fails with the following traceback:
jwa.py:152 is inside the the "_RawEC" constructor, so ... somehow, the wrong default key type is being used.
The issue could be reproduced with following section in
settings.yml
(RSA example key copied from https://connect2id.com/products/nimbus-jose-jwt/examples/jwk-generation#rsa)