pub struct Header {Show 16 fields
pub typ: Option<String>,
pub alg: Algorithm,
pub cty: Option<String>,
pub jku: Option<String>,
pub jwk: Option<Jwk>,
pub kid: Option<String>,
pub x5u: Option<String>,
pub x5c: Option<Vec<String>>,
pub x5t: Option<String>,
pub x5t_s256: Option<String>,
pub crit: Option<Vec<String>>,
pub enc: Option<Enc>,
pub zip: Option<Zip>,
pub url: Option<String>,
pub nonce: Option<String>,
pub extras: HashMap<String, String>,
}Expand description
A basic JWT header, the alg defaults to HS256 and typ is automatically
set to JWT. All the other fields are optional.
Fields§
§typ: Option<String>The type of JWS: it can only be “JWT” here
Defined in RFC7515#4.1.9.
alg: AlgorithmThe algorithm used
Defined in RFC7515#4.1.1.
cty: Option<String>Content type
Defined in RFC7519#5.2.
jku: Option<String>JSON Key URL
Defined in RFC7515#4.1.2.
jwk: Option<Jwk>JSON Web Key
Defined in RFC7515#4.1.3.
kid: Option<String>Key ID
Defined in RFC7515#4.1.4.
x5u: Option<String>X.509 URL
Defined in RFC7515#4.1.5.
x5c: Option<Vec<String>>X.509 certificate chain. A Vec of base64 encoded ASN.1 DER certificates.
Defined in RFC7515#4.1.6.
x5t: Option<String>X.509 SHA1 certificate thumbprint
Defined in RFC7515#4.1.7.
x5t_s256: Option<String>X.509 SHA256 certificate thumbprint
Defined in RFC7515#4.1.8.
This will be serialized/deserialized as “x5t#S256”, as defined by the RFC.
crit: Option<Vec<String>>Critical - indicates header fields that must be understood by the receiver.
Defined in RFC7515#4.1.6.
enc: Option<Enc>See Enc for description.
zip: Option<Zip>See Zip for description.
url: Option<String>ACME: The URL to which this JWS object is directed
Defined in RFC8555#6.4.
nonce: Option<String>ACME: Random data for preventing replay attacks.
Defined in RFC8555#6.5.2.
extras: HashMap<String, String>Any additional non-standard headers not defined in RFC7515#4.1. Once serialized, all keys will be converted to fields at the root level of the header payload Ex: Dict(“custom” -> “header”) will be converted to “{“typ”: “JWT”, …, “custom”: “header”}“