Class JwsHeader
java.lang.Object
org.springframework.security.oauth2.jwt.JwsHeader
The JSON Web Signature (JWS) header is a JSON object representing the header parameters
 of a JSON Web Token, that describe the cryptographic operations used to digitally sign
 or create a MAC of the contents of the JWS Protected Header and JWS Payload.
- Since:
- 5.6
- See Also:
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionstatic JwsHeader.BuilderReturns a newJwsHeader.Builder, initialized with the providedheaders.Returns theJWA algorithmused to digitally sign the JWS or encrypt the JWE.Returns the content type header that declares the media type of the secured content (the payload).Returns the critical headers that indicates which extensions to the JWS/JWE/JWA specifications are being used that MUST be understood and processed.<T> TReturns the header value.Returns the headers.getJwk()Returns the JSON Web Key which is the public key that corresponds to the key used to digitally sign the JWS or encrypt the JWE.Returns the JWK Set URL that refers to the resource of a set of JSON-encoded public keys, one of which corresponds to the key used to digitally sign the JWS or encrypt the JWE.getKeyId()Returns the key ID that is a hint indicating which key was used to secure the JWS or JWE.getType()Returns the type header that declares the media type of the JWS/JWE.Returns the X.509 certificate chain that contains the X.509 public key certificate or certificate chain corresponding to the key used to digitally sign the JWS or encrypt the JWE.Deprecated.The SHA-1 algorithm has been proven to be vulnerable to collision attacks and should not be used.Returns the X.509 certificate SHA-256 thumbprint that is a base64url-encoded SHA-256 thumbprint (a.k.a.Returns the X.509 URL that refers to the resource for the X.509 public key certificate or certificate chain corresponding to the key used to digitally sign the JWS or encrypt the JWE.static JwsHeader.Builderwith(JwsAlgorithm jwsAlgorithm) Returns a newJwsHeader.Builder, initialized with the providedJwsAlgorithm.
- 
Method Details- 
getAlgorithmReturns theJWA algorithmused to digitally sign the JWS or encrypt the JWE.- Returns:
- the JwaAlgorithm
 
- 
withReturns a newJwsHeader.Builder, initialized with the providedJwsAlgorithm.- Parameters:
- jwsAlgorithm- the- JwsAlgorithm
- Returns:
- the JwsHeader.Builder
 
- 
fromReturns a newJwsHeader.Builder, initialized with the providedheaders.- Parameters:
- headers- the headers
- Returns:
- the JwsHeader.Builder
 
- 
getJwkSetUrlReturns the JWK Set URL that refers to the resource of a set of JSON-encoded public keys, one of which corresponds to the key used to digitally sign the JWS or encrypt the JWE.- Returns:
- the JWK Set URL
 
- 
getJwkReturns the JSON Web Key which is the public key that corresponds to the key used to digitally sign the JWS or encrypt the JWE.- Returns:
- the JSON Web Key
 
- 
getKeyIdReturns the key ID that is a hint indicating which key was used to secure the JWS or JWE.- Returns:
- the key ID
 
- 
getX509UrlReturns the X.509 URL that refers to the resource for the X.509 public key certificate or certificate chain corresponding to the key used to digitally sign the JWS or encrypt the JWE.- Returns:
- the X.509 URL
 
- 
getX509CertificateChainReturns the X.509 certificate chain that contains the X.509 public key certificate or certificate chain corresponding to the key used to digitally sign the JWS or encrypt the JWE. The certificate or certificate chain is represented as aListof certificate valueStrings. EachStringin theListis a Base64-encoded DER PKIX certificate value.- Returns:
- the X.509 certificate chain
 
- 
getX509SHA1ThumbprintDeprecated.The SHA-1 algorithm has been proven to be vulnerable to collision attacks and should not be used. See the Google Security Blog for more info.Returns the X.509 certificate SHA-1 thumbprint that is a base64url-encoded SHA-1 thumbprint (a.k.a. digest) of the DER encoding of the X.509 certificate corresponding to the key used to digitally sign the JWS or encrypt the JWE.- Returns:
- the X.509 certificate SHA-1 thumbprint
- See Also:
 
- 
getX509SHA256ThumbprintReturns the X.509 certificate SHA-256 thumbprint that is a base64url-encoded SHA-256 thumbprint (a.k.a. digest) of the DER encoding of the X.509 certificate corresponding to the key used to digitally sign the JWS or encrypt the JWE.- Returns:
- the X.509 certificate SHA-256 thumbprint
 
- 
getTypeReturns the type header that declares the media type of the JWS/JWE.- Returns:
- the type header
 
- 
getContentTypeReturns the content type header that declares the media type of the secured content (the payload).- Returns:
- the content type header
 
- 
getCriticalReturns the critical headers that indicates which extensions to the JWS/JWE/JWA specifications are being used that MUST be understood and processed.- Returns:
- the critical headers
 
- 
getHeadersReturns the headers.- Returns:
- the headers
 
- 
getHeaderReturns the header value.- Type Parameters:
- T- the type of the header value
- Parameters:
- name- the header name
- Returns:
- the header value
 
 
-