public interface JWSMinter<C extends SecurityContext>
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).Modifier and Type | Method and Description |
---|---|
JWSObject |
mint(JWSHeader header,
Payload payload,
C context)
|
JWSObject mint(JWSHeader header, Payload payload, C context) throws JOSEException
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.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.JOSEException
- If the instance is improperly configured, if
no appropriate JWK could be found, or if signing failed.Copyright © 2021 Connect2id Ltd.. All rights reserved.