From e22ca3819ed3fc5ce6b58b289c6c4b5a16dc8f25 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Wed, 1 Jan 2020 00:00:00 +0100 Subject: Add a function to hash a public key for DPoP. --- tests/jkt.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/jkt.scm (limited to 'tests/jkt.scm') 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))))) -- cgit v1.2.3