struct

Rayo::JWT::Key

Inherits Struct < Value < Object

Value type: precomputed key states are copied onto the stack for every MAC.

Constructors

new(secret : String)
Source
new(secret : Bytes)
Source

Instance methods

sign(payload : Bytes, output : Bytes) : Bytes

The returned slice borrows output. Payload must be a JSON object.

Source
sign(payload : String, output : Bytes) : Bytes
Source
verify(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.

Source
verify(token : String, scratch : Bytes, now : Int64, leeway : Int32 = 0) : JSON::Reader | Nil
Source