public class DefaultJwsHeader extends DefaultHeader implements JwsHeader
ALGORITHM, CRITICAL, JSON_WEB_KEY, JWK_SET_URL, KEY_ID, X509_CERT_CHAIN, X509_CERT_SHA1_THUMBPRINT, X509_CERT_SHA256_THUMBPRINT, X509_URL
COMPRESSION_ALGORITHM, CONTENT_TYPE, DEPRECATED_COMPRESSION_ALGORITHM, JWT_TYPE, TYPE
构造器和说明 |
---|
DefaultJwsHeader() |
DefaultJwsHeader(java.util.Map<java.lang.String,java.lang.Object> map) |
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getAlgorithm()
Returns the JWS
alg (algorithm) header value or null if not present. |
java.lang.String |
getKeyId()
Returns the JWS
kid (Key ID) header value or null if not present. |
JwsHeader |
setAlgorithm(java.lang.String alg)
Sets the JWT
alg (Algorithm) header value. |
JwsHeader |
setKeyId(java.lang.String kid)
Sets the JWT
kid (Key ID) header value. |
getCompressionAlgorithm, getContentType, getType, setCompressionAlgorithm, setContentType, setType
clear, containsKey, containsValue, entrySet, equals, get, getDate, getString, hashCode, isEmpty, keySet, put, putAll, remove, setDate, setValue, size, toDate, toString, values
getCompressionAlgorithm, getContentType, getType, setCompressionAlgorithm, setContentType, setType
public DefaultJwsHeader()
public DefaultJwsHeader(java.util.Map<java.lang.String,java.lang.Object> map)
public java.lang.String getAlgorithm()
JwsHeader
alg
(algorithm) header value or null
if not present.
The algorithm header parameter identifies the cryptographic algorithm used to secure the JWS. Consider
using SignatureAlgorithm.forName
to convert this
string value to a type-safe enum instance.
getAlgorithm
在接口中 JwsHeader
alg
header value or null
if not present. This will always be
non-null
on validly constructed JWS instances, but could be null
during construction.public JwsHeader setAlgorithm(java.lang.String alg)
JwsHeader
alg
(Algorithm) header value. A null
value will remove the property from the JSON map.
The algorithm header parameter identifies the cryptographic algorithm used to secure the JWS. Consider
using a type-safe SignatureAlgorithm
instance and using its
value
as the argument to this method.
setAlgorithm
在接口中 JwsHeader
alg
- the JWS alg
header value or null
to remove the property from the JSON map.Header
instance for method chaining.public java.lang.String getKeyId()
JwsHeader
kid
(Key ID) header value or null
if not present.
The keyId header parameter is a hint indicating which key was used to secure the JWS. This parameter allows originators to explicitly signal a change of key to recipients. The structure of the keyId value is unspecified.
When used with a JWK, the keyId value is used to match a JWK keyId
parameter value.
public JwsHeader setKeyId(java.lang.String kid)
JwsHeader
kid
(Key ID) header value. A null
value will remove the property from the JSON map.
The keyId header parameter is a hint indicating which key was used to secure the JWS. This parameter allows originators to explicitly signal a change of key to recipients. The structure of the keyId value is unspecified.
When used with a JWK, the keyId value is used to match a JWK keyId
parameter value.