diff options
author | Vivien Kraus <vivien@planete-kraus.eu> | 2020-11-29 11:43:02 +0100 |
---|---|---|
committer | Vivien Kraus <vivien@planete-kraus.eu> | 2021-05-11 00:14:33 +0200 |
commit | 22c48cd31510cda51c7e67cd9cab61f2069579b7 (patch) | |
tree | fec536cba5e2b8f3ba1762e7b702cc3f7fe8df90 /src/scm/webid-oidc/errors.scm | |
parent | d36c331137eb2016d044ce948cf0989c23fecab0 (diff) |
Provide a higher-level API for JWKs and JWKSs
Diffstat (limited to 'src/scm/webid-oidc/errors.scm')
-rw-r--r-- | src/scm/webid-oidc/errors.scm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/scm/webid-oidc/errors.scm b/src/scm/webid-oidc/errors.scm index b575a77..a690088 100644 --- a/src/scm/webid-oidc/errors.scm +++ b/src/scm/webid-oidc/errors.scm @@ -54,6 +54,36 @@ (raise-exception ((record-constructor ¬-a-jwk) value cause))) +(define-public ¬-a-public-jwk + (make-exception-type + '¬-a-public-jwk + &external-error + '(value cause))) + +(define-public (raise-not-a-public-jwk value cause) + (raise-exception + ((record-constructor ¬-a-public-jwk) value cause))) + +(define-public ¬-a-private-jwk + (make-exception-type + '¬-a-private-jwk + &external-error + '(value cause))) + +(define-public (raise-not-a-private-jwk value cause) + (raise-exception + ((record-constructor ¬-a-private-jwk) value cause))) + +(define-public ¬-a-jwks + (make-exception-type + '¬-a-jwks + &external-error + '(value cause))) + +(define-public (raise-not-a-jwks value cause) + (raise-exception + ((record-constructor ¬-a-jwks) value cause))) + (define-public &unsupported-alg (make-exception-type '&unsupported-alg @@ -92,6 +122,27 @@ (get 'value) cause) (format #f (G_ "the value ~s does not identify a JWK") (get 'value))))) + ((¬-a-public-jwk) + (let ((cause (get 'cause))) + (if cause + (format #f (G_ "the value ~s does not identify a public JWK (because ~a)") + (get 'value) cause) + (format #f (G_ "the value ~s does not identify a public JWK") + (get 'value))))) + ((¬-a-private-jwk) + (let ((cause (get 'cause))) + (if cause + (format #f (G_ "the value ~s does not identify a private JWK (because ~a)") + (get 'value) cause) + (format #f (G_ "the value ~s does not identify a private JWK") + (get 'value))))) + ((¬-a-jwks) + (let ((cause (get 'cause))) + (if cause + (format #f (G_ "the value ~s does not identify a JWKS (because ~a)") + (get 'value) cause) + (format #f (G_ "the value ~s does not identify a JWKS") + (get 'value))))) ((&unsupported-alg) (format #f (G_ "the value ~s does not identify a hash algorithm") (get 'value))) |