Skip to content

Commit

Permalink
Handle PSS in keys.PrivateKeyInfo.wrap() / keys.PublicKeyInfo.wrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Mar 15, 2022
1 parent 0bb7066 commit d0040c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asn1crypto/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def wrap(cls, private_key, algorithm):
type_name(private_key)
))

if algorithm == 'rsa':
if algorithm == 'rsa' or algorithm == 'rsassa_pss':
if not isinstance(private_key, RSAPrivateKey):
private_key = RSAPrivateKey.load(private_key)
params = Null()
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def wrap(cls, public_key, algorithm):
type_name(public_key)
))

if algorithm != 'rsa':
if algorithm != 'rsa' and algorithm != 'rsassa_pss':
raise ValueError(unwrap(
'''
algorithm must "rsa", not %s
Expand Down

0 comments on commit d0040c2

Please sign in to comment.