JWT
public class JWT
Encapsultes a JSON Web Token.
-
URL to token issuer.
Declaration
Swift
public var issuer: String -
Intended audience of the token.
Declaration
Swift
public var audience: String -
Identity associated with the token.
Declaration
Swift
public var subject: String? -
Signature algorithm.
Declaration
Swift
public var algorithm: String -
External Key ID.
Declaration
Swift
public var keyId: String? -
Token expiry.
Declaration
Swift
public var expiry: Date -
Date/time at which the token was issued.
Declaration
Swift
public var issuedAt: Date -
Token is not valid before this time.
Declaration
Swift
public var notValidBefore: Date? -
Token ID.
Declaration
Swift
public var id: String? -
JWT payload.
Declaration
Swift
public var payload: [String : Any] -
Initialize and return
JWTobject.Declaration
Swift
public init(issuer: String, audience: String, subject: String, id: String)Parameters
issuerToken issuer
audienceIntended audience of the token.
subjectIdentity associated with the token.
idUnique ID of this token.
Return Value
Reference to the initialized object.
-
Initialize and return the object.
Declaration
Swift
public init(string: String, keyManager: SudoKeyManager? = nil) throwsParameters
stringJWT string.
keyManagerKeyManagerinstance used to validate the signature (optional). -
Sign and encode the token.
Declaration
Swift
public func signAndEncode(keyManager: SudoKeyManager, keyId: String) throws -> StringParameters
keyManagerKeyManager instance used to generate a digital signature.
keyIdIdentifier of the key to use for generate the signature.
JWT Class Reference