Header
public struct Header : Codable
A representation of a JSON Web Token header. https://tools.ietf.org/html/rfc7515#section-4.1
Usage Example:
struct MyClaims: Claims {
var name: String
}
let myHeader = Header(kid: "keyID")
let jwt = JWT(header: myHeader, claims: MyClaims(name: "Kitura"))
-
Type Header Parameter
Declaration
Swift
public var typ: String?
-
Algorithm Header Parameter
Declaration
Swift
public internal(set) var alg: String? { get }
-
JSON Web Token Set URL Header Parameter
Declaration
Swift
public var jku: String?
-
JSON Web Key Header Parameter
Declaration
Swift
public var jwk: String?
-
Key ID Header Parameter
Declaration
Swift
public var kid: String?
-
X.509 URL Header Parameter
Declaration
Swift
public var x5u: String?
-
X.509 Certificate Chain Header Parameter
Declaration
Swift
public var x5c: [String]?
-
X.509 Certificate SHA-1 Thumbprint Header Parameter
Declaration
Swift
public var x5t: String?
-
X.509 Certificate SHA-256 Thumbprint Header Parameter
Declaration
Swift
public var x5tS256: String?
-
Content Type Header Parameter
Declaration
Swift
public var cty: String?
-
Critical Header Parameter
Declaration
Swift
public var crit: [String]?
-
Initialize a
Header
instance.Declaration
Swift
public init( typ: String? = "JWT", jku: String? = nil, jwk: String? = nil, kid: String? = nil, x5u: String? = nil, x5c: [String]? = nil, x5t: String? = nil, x5tS256: String? = nil, cty: String? = nil, crit: [String]? = nil )
Parameters
typ
The Type Header Parameter
jku
The JSON Web Token Set URL Header Parameter
jwk
The JSON Web Key Header Parameter
kid
The Key ID Header Parameter
x5u
The X.509 URL Header Parameter
x5c
The X.509 Certificate Chain Header Parameter
x5t
The X.509 Certificate SHA-1 Thumbprint Header Parameter
x5tS256
X.509 Certificate SHA-256 Thumbprint Header Parameter
cty
The Content Type Header Parameter
crit
The Critical Header Parameter
Return Value
A new instance of
Header
.