diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2020-01-01 00:00:00 +0100 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-06-18 15:43:46 +0200 |
commit | e22ca3819ed3fc5ce6b58b289c6c4b5a16dc8f25 (patch) | |
tree | ea77e9354a4cf8bb3b9735a910c976fe9ceed818 /tests/jkt.scm | |
parent | 8a71b9e05da3df3e2a48d8ac22cf5d772f151211 (diff) |
Add a function to hash a public key for DPoP.
Diffstat (limited to 'tests/jkt.scm')
-rw-r--r-- | tests/jkt.scm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/jkt.scm b/tests/jkt.scm new file mode 100644 index 0000000..ca20f89 --- /dev/null +++ b/tests/jkt.scm @@ -0,0 +1,23 @@ +(use-modules (webid-oidc stubs) + (webid-oidc testing)) + +(with-test-environment + "jkt" + (lambda () + (let* ((key (json-string->scm "{ + \"kty\":\"EC\", + \"x\":\"l8tFrhx-34tV3hRICRDY9zCkDlpBhF42UQUfWVAWBFs\", + \"y\":\"9VE4jf_Ok_o64zbTTlcuNJajHmt6v9TDVrU0CdvGRDA\", + \"crv\":\"P-256\" + }")) + (jkt (jkt key)) + (expected "0ZcOCORZNYy-DWpqq30jZyJGHTN0d2HglBV3uiguA4I")) + (unless (string=? jkt expected) + (format (current-error-port) + "The JKT algorithm is not correct: +expected: ~a +obtained: ~a +" + expected + jkt) + (exit 1))))) |