Rayo::JWT::Key
Inherits Struct < Value < Object
Value type: precomputed key states are copied onto the stack for every MAC.
Constructors
new(secret : String)
Sourcenew(secret : Bytes)
SourceInstance methods
sign(payload : Bytes, output : Bytes) : Bytes
The returned slice borrows output. Payload must be a JSON object.
sign(payload : String, output : Bytes) : Bytes
Sourceverify(token : Bytes, scratch : Bytes, now : Int64, leeway : Int32 = 0) : JSON::Reader | Nil
Claims borrow scratch until it is reused. No global or per-request state. Optional NumericDate claims are checked; iat in the future is rejected.
verify(token : String, scratch : Bytes, now : Int64, leeway : Int32 = 0) : JSON::Reader | Nil
Source