class JWT::JWA::Eddsa
Implementation of the EdDSA family of algorithms
Public Class Methods
Public Instance Methods
Source
# File lib/jwt/jwa/eddsa.rb, line 13 def sign(data:, signing_key:) raise_sign_error!("Key given is a #{signing_key.class} but has to be an RbNaCl::Signatures::Ed25519::SigningKey") unless signing_key.is_a?(RbNaCl::Signatures::Ed25519::SigningKey) Deprecations.warning('Using Ed25519 keys is deprecated and will be removed in a future version of ruby-jwt. Please use the ruby-eddsa gem instead.') signing_key.sign(data) end
Source
# File lib/jwt/jwa/eddsa.rb, line 21 def verify(data:, signature:, verification_key:) raise_verify_error!("key given is a #{verification_key.class} but has to be a RbNaCl::Signatures::Ed25519::VerifyKey") unless verification_key.is_a?(RbNaCl::Signatures::Ed25519::VerifyKey) Deprecations.warning('Using Ed25519 keys is deprecated and will be removed in a future version of ruby-jwt. Please use the ruby-eddsa gem instead.') verification_key.verify(signature, data) rescue RbNaCl::CryptoError false end