Class JwtSigningHeader
java.lang.Object
com.revetsec.jose.JwtSigningHeader
Immutable protected-header metadata for signing a JWT: its required
type and optional key
identifier and SHA-256 certificate thumbprint. The alg header comes from the JwsSigner; callers
cannot configure a conflicting algorithm here.
Arrays are defensively copied. String rendering never exposes configured identifiers or certificate digests.
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classConfigures an immutable JWT signing header without signing or I/O. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull JwtSigningHeaderReturns a header with the required token type and no key identifier or certificate thumbprint.Returns a copy of the optional SHA-256 digest of a DER certificate, serialized asx5t#S256when signing.getKeyId()Returns the optional protected-headerkidvalue.getType()Returns the required protected-headertypselection.toString()Returns a description without configured identifiers or certificate digests.static @NonNull JwtSigningHeader.BuilderStarts a header builder with the required token type.
-
Method Details
-
withType
Starts a header builder with the required token type.- Parameters:
type- the protected-header token type- Returns:
- the builder
- Throws:
NullPointerException- iftypeisnull- Since:
- 1.0.0
-
fromType
Returns a header with the required token type and no key identifier or certificate thumbprint. Equivalent towithType(type).build().- Parameters:
type- the protected-header token type- Returns:
- the immutable header
- Throws:
NullPointerException- iftypeisnull- Since:
- 1.0.0
-
getType
-
getKeyId
-
getCertificateSha256Thumbprint
Returns a copy of the optional SHA-256 digest of a DER certificate, serialized asx5t#S256when signing.- Returns:
- a copy of the certificate digest when configured
- Since:
- 1.0.0
-
toString
-