public class DefaultHeader<T extends Header<T>> extends JwtMap implements Header<T>
COMPRESSION_ALGORITHM, CONTENT_TYPE, DEPRECATED_COMPRESSION_ALGORITHM, JWT_TYPE, TYPE
构造器和说明 |
---|
DefaultHeader() |
DefaultHeader(java.util.Map<java.lang.String,java.lang.Object> map) |
限定符和类型 | 方法和说明 |
---|---|
java.lang.String |
getCompressionAlgorithm()
Returns the JWT
calg (Compression Algorithm) header value or null if not present. |
java.lang.String |
getContentType()
Returns the
cty (Content Type) header value or null if not present. |
java.lang.String |
getType()
Returns the
typ (type) header value or null if not present. |
T |
setCompressionAlgorithm(java.lang.String compressionAlgorithm)
Sets the JWT
calg (Compression Algorithm) header parameter value. |
T |
setContentType(java.lang.String cty)
Sets the JWT
cty (Content Type) header parameter value. |
T |
setType(java.lang.String typ)
Sets the JWT
typ (Type) header value. |
public DefaultHeader()
public DefaultHeader(java.util.Map<java.lang.String,java.lang.Object> map)
public java.lang.String getType()
Header
typ
(type) header value or null
if not present.public T setType(java.lang.String typ)
Header
typ
(Type) header value. A null
value will remove the property from the JSON map.public java.lang.String getContentType()
Header
cty
(Content Type) header value or null
if not present.
In the normal case where nested signing or encryption operations are not employed (i.e. a compact
serialization JWT), the use of this header parameter is NOT RECOMMENDED. In the case that nested
signing or encryption is employed, this Header Parameter MUST be present; in this case, the value MUST be
JWT
, to indicate that a Nested JWT is carried in this JWT. While media type names are not
case-sensitive, it is RECOMMENDED that JWT
always be spelled using uppercase characters for
compatibility with legacy implementations. See
JWT Appendix A.2 for
an example of a Nested JWT.
getContentType
在接口中 Header<T extends Header<T>>
typ
header parameter value or null
if not present.public T setContentType(java.lang.String cty)
Header
cty
(Content Type) header parameter value. A null
value will remove the property from
the JSON map.
In the normal case where nested signing or encryption operations are not employed (i.e. a compact
serialization JWT), the use of this header parameter is NOT RECOMMENDED. In the case that nested
signing or encryption is employed, this Header Parameter MUST be present; in this case, the value MUST be
JWT
, to indicate that a Nested JWT is carried in this JWT. While media type names are not
case-sensitive, it is RECOMMENDED that JWT
always be spelled using uppercase characters for
compatibility with legacy implementations. See
JWT Appendix A.2 for
an example of a Nested JWT.
setContentType
在接口中 Header<T extends Header<T>>
cty
- the JWT JOSE cty
header value or null
to remove the property from the JSON map.public java.lang.String getCompressionAlgorithm()
Header
calg
(Compression Algorithm) header value or null
if not present.getCompressionAlgorithm
在接口中 Header<T extends Header<T>>
calg
header parameter value or null
if not present.public T setCompressionAlgorithm(java.lang.String compressionAlgorithm)
Header
calg
(Compression Algorithm) header parameter value. A null
value will remove
the property from the JSON map.
The compression algorithm is NOT part of the JWT specification and must be used carefully since, is not expected that other libraries (including previous versions of this one) be able to deserialize a compressed JTW body correctly.
setCompressionAlgorithm
在接口中 Header<T extends Header<T>>
compressionAlgorithm
- the JWT compression algorithm calg
value or null
to remove the property from the JSON map.