Class ServletJwks

java.lang.Object
com.revetsec.servlet.jakarta.ServletJwks

@ThreadSafe public final class ServletJwks extends Object
Publishes standalone public JSON Web Key Sets on application-owned Servlet routes. The core publisher prepares method handling, conditional responses, cache headers and JSON bytes. Applications choose the route and its key set; no OAuth authorization server is required.
Since:
1.0.0
  • Method Details

    • writeResponse

      public static void writeResponse(@NonNull JwksPublisher publisher, @NonNull jakarta.servlet.http.HttpServletRequest request, @NonNull jakarta.servlet.http.HttpServletResponse response) throws IOException
      Prepares and writes a standalone JWKS response using every If-None-Match occurrence. Servlet header lookup is case-insensitive and retains repeated physical field values.
      Parameters:
      publisher - configured public-key publisher
      request - request on the application's JWKS route
      response - application-owned transport response
      Throws:
      NullPointerException - if a required argument is null
      IllegalStateException - if the Servlet does not expose request headers
      IOException - if the Servlet output stream fails
      Since:
      1.0.0
    • writeResponse

      public static void writeResponse(@NonNull jakarta.servlet.http.HttpServletResponse response, @NonNull JwksResponse prepared) throws IOException
      Writes a prepared core response without JSON marshalling or header regeneration. A prepared HEAD or not-modified response does not obtain or write the output stream.
      Parameters:
      response - application-owned transport response
      prepared - prepared standalone JWKS response
      Throws:
      NullPointerException - if a required argument is null
      IOException - if the Servlet output stream fails
      Since:
      1.0.0