Record

jwt-header

JWT header structure.

The alg defaults to HS256 and typ is automatically set to JWT. All other fields are optional.

record jwt-header {
  typ: option​<string>,
  alg: algorithm,
  cty: option​<string>,
  jku: option​<string>,
  jwk: option​<jwk>,
  kid: option​<string>,
  x5u: option​<string>,
  x5c: option​<list​<string>>,
  x5t: option​<string>,
  x5t-s256: option​<string>,
  extras: extras,
}

Fields

NameTypeDescription
typoption​<string>

The type of JWS: it can only be "JWT" here

Defined in RFC7515#4.1.9.

algalgorithm

The algorithm used

Defined in RFC7515#4.1.1.

ctyoption​<string>

Content type

Defined in RFC7519#5.2.

jkuoption​<string>

JSON Key URL

jwkoption​<jwk>

JSON Web Key

Defined in RFC7515#4.1.3.

kidoption​<string>

Key ID

Defined in RFC7515#4.1.4.

x5uoption​<string>

X.509 URL

Defined in RFC7515#4.1.5.

x5coption​<list​<string>>

X.509 certificate chain. A Vec of base64 encoded ASN.1 DER certificates.

Defined in RFC7515#4.1.6.

x5toption​<string>

X.509 SHA1 certificate thumbprint

Defined in RFC7515#4.1.7.

x5t-s256option​<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.

extrasextras

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"}"