Jwt
@objc(VSSJwt)
public final class Jwt : NSObject, AccessToken
Class implementing AccessToken in terms of Virgil JWT
-
Represents JWT Header content
Declaration
Swift
@objc public let headerContent: JwtHeaderContent -
Represents JWT Body content
Declaration
Swift
@objc public let bodyContent: JwtBodyContent -
Represents JWT Signature content
Declaration
Swift
@objc public let signatureContent: JwtSignatureContent -
Initializes
Jwtwith provided header, body and signature contentDeclaration
Swift
@objc public init(headerContent: JwtHeaderContent, bodyContent: JwtBodyContent, signatureContent: JwtSignatureContent) throwsParameters
headerContentheader of
JwtbodyContentbody of
JwtsignatureContentsignature of
Jwt -
Initializes
Jwtfrom its string representationDeclaration
Swift
@objc public init(stringRepresentation: String) throwsParameters
stringRepresentationmust be equal to base64UrlEncode(JWT Header) + “.” + base64UrlEncode(JWT Body) + “.” + base64UrlEncode(Jwt Signature)
-
Returns JWT data that should be signed
Throws
JwtError.utf8StrIsInvalid if utf8 string is invalidDeclaration
Swift
@objc public func dataToSign() throws -> DataReturn Value
JWT data that should be signed
-
Returns JWT data that should be signed
Throws
JwtError.utf8StrIsInvalid if utf8 string is invalidDeclaration
Swift
@objc public static func dataToSign(headerContent: JwtHeaderContent, bodyContent: JwtBodyContent) throws -> DataParameters
headerContentJWT header
bodyContentJWT body
Return Value
JWT data that should be signed
-
Provides string representation of token
Declaration
Swift
public func stringRepresentation() -> StringReturn Value
string representation of token
-
Extracts identity
Declaration
Swift
public func identity() -> StringReturn Value
identity
-
Returns whether or not token is expired
Declaration
Swift
@objc public func isExpired(date: Date = Date()) -> BoolParameters
datecurrent date
Return Value
true if token is expired, false otherwise
Jwt Class Reference