File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,16 @@ def generate_and_verify_jwk(client):
94
94
95
95
r = client .post ("/app/rsaJwkToPem" , body = {"jwk" : body })
96
96
body = r .body .json ()
97
- assert r .status_code == http .HTTPStatus .OK
98
- assert body ["pem" ] == priv_pem
97
+ converted_pem = body ["pem" ]
98
+
99
+ # PEMs may vary because of discrepancies of RSA key private components
100
+ # computation, in particular, using Euler VS Carmichael totient
101
+ # functions. For more details check the thread:
102
+ # https://github.com/microsoft/CCF/issues/6588#issuecomment-2568037993.
103
+ algorithm = {"name" : "RSA-PSS" , "hash" : "SHA-256" }
104
+ data = rand_bytes (random .randint (2 , 50 ))
105
+ signature = infra .crypto .sign (algorithm , converted_pem , data )
106
+ infra .crypto .verify_signature (algorithm , signature , data , pub_pem )
99
107
100
108
# Public
101
109
ref_pub_jwk = jwk .JWK .from_pem (pub_pem .encode ()).export (as_dict = True )
You can’t perform that action at this time.
0 commit comments