Class JWS.Signature
java.lang.Object
de.christofreichardt.json.websignature.JWS.Signature
- All Implemented Interfaces:
de.christofreichardt.diagnosis.Traceable, BeforeHeader, BeforeKid, BeforePayload, SignatureBegin, SignatureEnd
- Enclosing class:
JWS
protected static class JWS.Signature
extends Object
implements SignatureBegin, BeforePayload, BeforeHeader, BeforeKid, SignatureEnd, de.christofreichardt.diagnosis.Traceable
Implements all interfaces of the Fluent API related to creating signatures.
- Author:
- Christof Reichardt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.christofreichardt.diagnosis.AbstractTracerNotes the given explicit JOSE header.The givenKeyPairwill be used to build aJsonWebKeyPair.The givenSecretKeywill be used to build aJsonWebSecretKey.Notes the givenkid.payload(jakarta.json.JsonStructure payload) Introduces the actual payload.Introduces the actual payload as string.sign()Uses the gathered information to create a JSON Web Signature.sign(Json2StringConverter converter) Uses the gathered information to create a JSON Web Signature.Notes the giventyp.webkey(JsonWebKeyPair jsonWebKeyPair) Notes the givenJsonWebKeyPair.webkey(JsonWebSecretKey jsonWebSecretKey) Notes the givenJsonWebSecretKey.
-
Constructor Details
-
Signature
protected Signature()
-
-
Method Details
-
payload
Description copied from interface:BeforePayloadIntroduces the actual payload.- Specified by:
payloadin interfaceBeforePayload- Parameters:
payload- the given payload- Returns:
- the last step within the workflow of the Fluent API regarding the generation of signatures.
-
payload
Description copied from interface:BeforePayloadIntroduces the actual payload as string. The string must be valid JSON at present.- Specified by:
payloadin interfaceBeforePayload- Parameters:
strPayload- the given payload.- Returns:
- the last step within the workflow of the Fluent API regarding the generation of signatures.
-
webkey
Description copied from interface:SignatureBeginNotes the givenJsonWebKeyPair. The private part will be used for generating the actual signature. The public part will be exposed within the JOSE header if you don't chose to explicitly hand over a JOSE header yourself within the next step.- Specified by:
webkeyin interfaceSignatureBegin- Parameters:
jsonWebKeyPair- the givenJsonWebKeyPair.- Returns:
- the next stop within the workflow of the Fluent API regarding the generation of signatures.
-
webkey
Description copied from interface:SignatureBeginNotes the givenJsonWebSecretKey. The wrapped secret key will be used for generating the signature.- Specified by:
webkeyin interfaceSignatureBegin- Parameters:
jsonWebSecretKey- the givenJsonWebSecretKey.- Returns:
- the next stop within the workflow of the Fluent API regarding the generation of signatures.
-
key
Description copied from interface:SignatureBeginThe givenKeyPairwill be used to build aJsonWebKeyPair. The private part will be used for generating the actual signature. The public part will be exposed within the JOSE header if you don't chose to explicitly hand over a JOSE header yourself within the next step.- Specified by:
keyin interfaceSignatureBegin- Parameters:
keyPair- the givenKeyPair.- Returns:
- the next stop within the workflow of the Fluent API regarding the generation of signatures.
-
key
Description copied from interface:SignatureBeginThe givenSecretKeywill be used to build aJsonWebSecretKey.- Specified by:
keyin interfaceSignatureBegin- Parameters:
secretKey- the givenSecretKey.- Returns:
- the next stop within the workflow of the Fluent API regarding the generation of signatures.
-
sign
Description copied from interface:SignatureEndUses the gathered information to create a JSON Web Signature.- Specified by:
signin interfaceSignatureEnd- Returns:
- a
JWSCompactSerialization - Throws:
GeneralSecurityException- passed through from the underlying implementations of the algorithms by the JDK
-
sign
Description copied from interface:SignatureEndUses the gathered information to create a JSON Web Signature. The providedJson2StringConverteris used to predictably format the JSON input prior to generating the signature.- Specified by:
signin interfaceSignatureEnd- Parameters:
converter- the to be usedJson2StringConverter- Returns:
- a
JWSCompactSerialization - Throws:
GeneralSecurityException- passed through from the underlying implementations of the algorithms by the JDK
-
kid
Description copied from interface:BeforeKidNotes the givenkid. -
typ
Description copied from interface:BeforeHeaderNotes the giventyp.- Specified by:
typin interfaceBeforeHeader- Parameters:
typ- the giventyp.- Returns:
- the next stop within the workflow of the Fluent API regarding the generation of signatures.
- See Also:
-
header
Description copied from interface:BeforeHeaderNotes the given explicit JOSE header. You are responsible for the correct representation of the JOSE header.- Specified by:
headerin interfaceBeforeHeader- Parameters:
strHeader- the given explicit JOSE header.- Returns:
- the next stop within the workflow of the Fluent API regarding the generation of signatures.
-
getCurrentTracer
public de.christofreichardt.diagnosis.AbstractTracer getCurrentTracer()- Specified by:
getCurrentTracerin interfacede.christofreichardt.diagnosis.Traceable
-