Documentation

Hale.Jose.Crypto.JOSE.Types

JWS signing algorithms (RFC 7518 §3.1). $$\text{JWSAlgorithm} \in \{\text{HS256}, \text{RS256}, \text{ES256}, \ldots\}$$

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[implicit_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      Roundtrip: fromString (toString a) = some a for all algorithms.

      isSymmetric returns true if and only if the algorithm is HS256, HS384, or HS512.

      Elliptic curves for EC keys (RFC 7518 §6.2.1.1).

      Instances For
        @[implicit_reducible]
        Equations
        • One or more equations did not get rendered due to their size.

        Roundtrip: fromString (toString c) = some c for all EC curves.

        @[implicit_reducible]

        Repr instance for ByteArray (not provided by Lean 4.30+ stdlib).

        Equations

        Key material for a JSON Web Key (RFC 7517). $$\text{JWKKeyMaterial} = \text{RSA}\ n\ e\ |\ \text{EC}\ \text{crv}\ x\ y\ |\ \text{Oct}\ k$$

        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Valid JWK key types per RFC 7518 §6.1.

            Instances For
              @[implicit_reducible]
              Equations
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[implicit_reducible]
                Equations
                • One or more equations did not get rendered due to their size.

                Roundtrip: fromString (toString k) = some k for all key types.

                Valid JWK public key usage values per RFC 7517 §4.2.

                Instances For
                  @[implicit_reducible]
                  Equations

                  A JSON Web Key (RFC 7517). $$\text{JWK} = \{ \text{kty}, \text{kid}?, \text{alg}?, \text{use}?, \text{material} \}$$

                  The kty field is a JWKKeyType (not a raw String), constraining it to the valid values "RSA", "EC", "oct" per RFC 7518 §6.1. The kty_material_coherent proof ensures the key type matches the key material.

                  Instances For
                    @[implicit_reducible]
                    Equations
                    • One or more equations did not get rendered due to their size.

                    A set of JWKs (RFC 7517 §5).

                    Instances For
                      @[implicit_reducible]
                      Equations

                      Registered claim names for JWTs (RFC 7519 §4.1).

                      Instances For
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Equations
                          Instances For

                            Look up a custom claim value by name.

                            Equations
                            Instances For

                              JWS JOSE Header (RFC 7515 §4).

                              Instances For
                                Equations
                                Instances For
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    Configuration for JWT validation. allowedSkew is bounded to at most 600 seconds (10 minutes) to prevent dangerously permissive clock skew that could accept expired/future tokens.

                                    • allowedSkew : Nat

                                      Allowed clock skew in seconds (max 600 = 10 minutes).

                                    • allowedSkew_bounded : self.allowedSkew 600

                                      The clock skew must not exceed 10 minutes (600 seconds).

                                    • checkExpiry : Bool

                                      Whether to check the exp claim.

                                    • checkNotBefore : Bool

                                      Whether to check the nbf claim.

                                    • audienceMatches : Option (List String)

                                      If set, the aud claim must contain one of these values.

                                    • issuerMatches : Option (List String)

                                      If set, the iss claim must be one of these values.

                                    Instances For
                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Errors that can occur during JWT validation.

                                        • malformedToken (msg : String) : JwtError

                                          The JWT string has an invalid format (not 3 dot-separated parts).

                                        • headerParseError (msg : String) : JwtError

                                          The header JSON cannot be parsed.

                                        • claimsParseError (msg : String) : JwtError

                                          The claims JSON cannot be parsed.

                                        • unsupportedAlgorithm (alg : String) : JwtError

                                          The algorithm in the header is not supported.

                                        • signatureVerificationFailed : JwtError

                                          Signature verification failed.

                                        • tokenExpired (exp now : Nat) : JwtError

                                          The token has expired.

                                        • tokenNotYetValid (nbf now : Nat) : JwtError

                                          The token is not yet valid.

                                        • audienceMismatch : JwtError

                                          The audience claim does not match.

                                        • issuerMismatch : JwtError

                                          The issuer claim does not match.

                                        • noMatchingKey : JwtError

                                          No matching key found in the key set.

                                        • noneAlgorithmNotAllowed : JwtError

                                          The "none" algorithm is not allowed.

                                        Instances For
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              @[implicit_reducible]
                                              Equations
                                              • One or more equations did not get rendered due to their size.