Class JwtSigningHeader.Builder
java.lang.Object
com.revetsec.jose.JwtSigningHeader.Builder
- Enclosing class:
JwtSigningHeader
Configures an immutable JWT signing header without signing or I/O. Optional setters replace their previous
value, and
null clears the value. Each build() call takes an independent snapshot.- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an immutable header snapshot without signing or I/O.certificateSha256Thumbprint(byte @Nullable [] certificateSha256Thumbprint) Replaces the optional SHA-256 digest of a DER certificate with a defensive copy.Replaces the optional protected-header key identifier.toString()Returns a description without configured identifiers or certificate digests.
-
Method Details
-
keyId
Replaces the optional protected-header key identifier. Text must contain 1–256 UTF-16 code units and valid Unicode.- Parameters:
keyId- the key identifier, ornullto clear it- Returns:
- this builder
- Throws:
IllegalArgumentException- if the supplied identifier is empty, too long or invalid Unicode- Since:
- 1.0.0
-
certificateSha256Thumbprint
public @NonNull JwtSigningHeader.Builder certificateSha256Thumbprint(byte @Nullable [] certificateSha256Thumbprint) Replaces the optional SHA-256 digest of a DER certificate with a defensive copy.- Parameters:
certificateSha256Thumbprint- exactly 32 digest bytes, ornullto clear it- Returns:
- this builder
- Throws:
IllegalArgumentException- if the supplied digest does not contain exactly 32 bytes- Since:
- 1.0.0
-
build
Builds an immutable header snapshot without signing or I/O.- Returns:
- the header
- Since:
- 1.0.0
-
toString
-