Interface JWSMinter<C extends SecurityContext>

    • Method Detail

      • 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 specified.
        Returns:
        The signed JWS object.
        Throws:
        JOSEException - If the instance is improperly configured, if no appropriate JWK could be found, or if signing failed.