Class JwsSigner.Builder
java.lang.Object
com.revetsec.jose.JwsSigner.Builder
- Enclosing class:
JwsSigner
Configures one signing operation. Header and claims are immutable snapshots; the builder owns no credential.
Each
build() starts a fresh budget, serializes the claims and signs on the caller thread. A trusted
JCA provider must cooperate with the budget; it cannot be forcibly interrupted. Callers enforcing an original
deadline must also recheck it after the operation.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Serializes the outbound claims, signs them and verifies the signature before returning the compact JWT.remainingBudget(@Nullable Duration remainingBudget) Sets the budget measured from entry tobuild(), including claims serialization and signing.toString()Returns a description without the header, claims, key or credential.
-
Method Details
-
remainingBudget
Sets the budget measured from entry tobuild(), including claims serialization and signing. Nonpositive values are exhausted and causebuild()to fail without signing.- Parameters:
remainingBudget- the remaining operation allowance, or null to restore the two-second default- Returns:
- this builder
- Since:
- 1.0.0
-
build
Serializes the outbound claims, signs them and verifies the signature before returning the compact JWT. This is an explicit credential emission; it does not validate the application meaning of the claims.- Returns:
- the verified compact JWT credential; keep it out of logs
- Throws:
IllegalArgumentException- if the claims exceed the signing JSON profile or size limitsJwsSigningException- if signing, pair verification or the operation budget fails- Since:
- 1.0.0
-
toString
-