JsonWebToken
Compact JSON Web Token (JWT) encoding: split, decode and sign.
Nebula · Packages/com.1by3.nebula/Runtime/Gateway/ClientAuth.cspublic static class JsonWebTokenCompact JSON Web Token (JWT) encoding: split, decode and sign. No policy lives here.
Methods
UnixNow
public static long UnixNow();TryParse
public static bool TryParse(string token, out Dictionary<string, object> header, out Dictionary<string, object> payload, out byte[] signedBytes, out byte[] signature, out string error);Split header.payload.signature and decode the two JSON objects. Does not verify anything.
SignHs256
public static string SignHs256(string payloadJson, byte[] key);An HS256 token over payloadJson.
Base64UrlEncode
public static string Base64UrlEncode(byte[] bytes);Base64UrlDecode
public static byte[] Base64UrlDecode(string s);Claim
public static string Claim(Dictionary<string, object> claims, string name);A claim as a string (numbers and booleans are formatted; missing = null).
NumericClaim
public static long? NumericClaim(Dictionary<string, object> claims, string name);A numeric claim (exp, iat), or null when missing or not a number.
HasAudience
public static bool HasAudience(Dictionary<string, object> claims, string audience);True when the aud claim (a string or an array of strings) names audience.
InterestLinkReason
Why a gateway holds a link to a worker.
MeshPeerAuth
How gateways and workers prove to each other that they belong to the mesh: HelloMsg.Token on an infrastructure link carries unixSeconds.base64url(HMAC-SHA256(key, role|id|incarnation|unixSeconds)) with a key derived from the mesh token (...