module

Authly::ChallengeVerifier

Constants

ED25519_SPKI_PREFIX = Bytes[48, 42, 48, 5, 6, 3, 43, 101, 112, 3, 33, 0]

Instance methods

verify?(challenge : String, response : String, public_key : String | Nil = nil, secret : String | Nil = nil, algorithm : String | Nil = nil) : Bool

Verifies a challenge response using asymmetric signature verification when public_key is provided, or HMAC-SHA256 when secret is provided.

Source
verify_asymmetric?(challenge : String, response : String, public_key : String, algorithm : String | Nil = nil) : Bool

Verifies an asymmetric signature (Ed25519, RSA PKCS#1 v1.5 / PSS, or ECDSA DER / raw P1363) against challenge.

Source
verify_ecdsa?(challenge : String, signatures : Array(Bytes), public_key : String, algorithm : String | Nil = nil) : Bool
Source
verify_ed25519?(challenge : String, signatures : Array(Bytes), public_key : String) : Bool
Source
verify_hmac?(challenge : String, response : String, secret : String, digest_algorithm : OpenSSL::Algorithm = OpenSSL::Algorithm::SHA256) : Bool

Verifies an HMAC challenge response using constant-time comparison across hex and Base64 encodings.

Source
verify_rsa?(challenge : String, signatures : Array(Bytes), public_key : String, algorithm : String | Nil = nil) : Bool
Source