module JWT

Extended Modules

Defined in:

jwt.cr
jwt/errors.cr
jwt/version.cr

Constant Summary

VERSION = "0.4.0"

Instance Method Summary

Instance Method Detail

def asn1_to_raw(signature : Bytes, private_key : OpenSSL::PKey::EC) : Bytes #

OpenSSL returns signatures encoded as ASN.1 values However the JWT specification requires these to be raw integers


[View source]
def decode(token : String, key : String = "", algorithm : Algorithm = Algorithm::None, verify = true, validate = true, **options) : Tuple #

[View source]
def decode(token : String, algorithm : Algorithm | Nil = nil, verify = true, validate = true, **options, &) : Tuple #

[View source]
def encode(payload, key : String, algorithm : Algorithm, **header_keys) : String #

[View source]
def encode_header(algorithm : Algorithm, **keys) : String #

[View source]
def encode_payload(payload) : String #

[View source]
def encoded_signature(algorithm : Algorithm, key : String, data : String) #

[View source]
def raw_to_asn1(signature : Bytes, public_key : OpenSSL::PKey::EC) : Bytes #

[View source]
def sign(algorithm : Algorithm, key : String, data : String) #

[View source]