Class JWSSigner
java.lang.Object
de.christofreichardt.json.websignature.JWSBase
de.christofreichardt.json.websignature.JWSSigner
- All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable
Low level class for the creating JSON web signatures. Subject to change. The preferred entry point is the Fluent API.
- Author:
- Christof Reichardt
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJWSSigner(jakarta.json.JsonObject joseHeader, jakarta.json.JsonStructure payload) Creates aJWSSignerwith the specified JOSE header and JSON payload.JWSSigner(jakarta.json.JsonObject joseHeader, jakarta.json.JsonStructure payload, Json2StringConverter converter) Creates aJWSSignerwith the specified JOSE header and JSON payload.Creates aJWSSignerwith the specified literal JOSE header and literal JSON payload as signing input (no conversion). -
Method Summary
Modifier and TypeMethodDescriptionde.christofreichardt.diagnosis.AbstractTracerGenerates the JSON web signature as compact serialization.Methods inherited from class JWSBase
decodeToBytes, encode, encode, getJoseHeader, getPayload, getStrJoseHeader, getStrPayload
-
Constructor Details
-
JWSSigner
public JWSSigner(jakarta.json.JsonObject joseHeader, jakarta.json.JsonStructure payload) Creates aJWSSignerwith the specified JOSE header and JSON payload. Delegates toJWSSigner(JsonObject, JsonStructure, Json2StringConverter)by passingJsonValue.toString()asJson2StringConverter.- Parameters:
joseHeader- the JOSE headerpayload- the JSON payload
-
JWSSigner
public JWSSigner(jakarta.json.JsonObject joseHeader, jakarta.json.JsonStructure payload, Json2StringConverter converter) Creates aJWSSignerwith the specified JOSE header and JSON payload.- Parameters:
joseHeader- the JOSE headerpayload- the JSON payloadconverter- the to be usedJson2StringConverter
-
JWSSigner
-
-
Method Details
-
sign
Generates the JSON web signature as compact serialization. In the event of assymetric algorithms (indicated by the JOSE header) this MUST be aPrivateKeywhereas symmetric algorithms require aSecretKey.- Parameters:
signingKey- the to usedKey- Returns:
- the JSON web signature as compact serialization
- Throws:
GeneralSecurityException- indicates that a problem occured during the signing process
-
getCurrentTracer
public de.christofreichardt.diagnosis.AbstractTracer getCurrentTracer()- Specified by:
getCurrentTracerin interfacede.christofreichardt.diagnosis.Traceable
-