Interface JWSMinter<C extends SecurityContext>

All Known Subinterfaces:
ConfigurableJWSMinter<C>
All Known Implementing Classes:
DefaultJWSMinter

public interface JWSMinter<C extends SecurityContext>
Interface for minting JSON Web Signature (JWS) objects and signed JSON Web Tokens (JWTs). An optional context parameter is available to facilitate passing of additional data between the caller and the underlying JWS minter (in both directions).
Version:
2021-01-14
Author:
Josh Cummings
  • Method Summary

    Modifier and Type
    Method
    Description
    mint(JWSHeader header, Payload payload, C context)
    Creates a new JSON Web Signature (JWS) object using the provided JWSHeader and Payload.
  • Method Details

    • mint

      JWSObject mint(JWSHeader header, Payload payload, C context) throws JOSEException
      Creates a new JSON Web Signature (JWS) object using the provided JWSHeader and Payload. To create a signed JSON Web Token (JWT) use the JWTClaimsSet.toPayload() method to obtain a Payload representation of the JWT claims. Derives the signing key from the JWSHeader as well as any application-specific context. Once the key is discovered, adds any headers related to the discovered signing key, including kid, x5u, x5c, and x5t#256. All other headers and claims remain as-is. This method expects the caller to add the typ, alg, and any other needed headers.
      Parameters:
      header - The JWSHeader to use, less any key-identifying headers, which this method will derive.
      payload - The Payload.
      context - A SecurityContext, null if not required.
      Returns:
      The signed JWS object.
      Throws:
      JOSEException - If the instance is improperly configured, if no appropriate JWK could be found, or if signing failed.