Skip to content

Commit

Permalink
Use the older OpenSSL::PKey::EC#private_key? method
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinj committed Dec 12, 2020
1 parent 2e581a9 commit 7475c50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/jwt/jwk/ec.rb
Expand Up @@ -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
Expand All @@ -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 = {
Expand Down

0 comments on commit 7475c50

Please sign in to comment.