From 7475c506489048a7834e00c4850b0dbf3ae4b954 Mon Sep 17 00:00:00 2001 From: Joakim Antman Date: Fri, 4 Dec 2020 07:46:48 +0200 Subject: [PATCH] Use the older OpenSSL::PKey::EC#private_key? method --- lib/jwt/jwk/ec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/jwt/jwk/ec.rb b/lib/jwt/jwk/ec.rb index 1c2f93f6..267426b4 100644 --- a/lib/jwt/jwk/ec.rb +++ b/lib/jwt/jwk/ec.rb @@ -4,7 +4,7 @@ module JWT module JWK class EC < KeyBase extend Forwardable - def_delegators :@keypair, :private?, :public_key + def_delegators :@keypair, :public_key KTY = 'EC'.freeze KTYS = [KTY, OpenSSL::PKey::EC].freeze @@ -17,6 +17,10 @@ def initialize(keypair, kid = nil) super(keypair, kid) end + def private? + @keypair.private_key? + end + def export(options = {}) crv, x_octets, y_octets = keypair_components(keypair) exported_hash = {