Skip to content

Commit

Permalink
Merge pull request #86 from dub357/expose_private_jwk_methods
Browse files Browse the repository at this point in the history
make a few private JWK methods now public
  • Loading branch information
nov authored May 22, 2020
2 parents 14f8882 + b07b900 commit 24f8b94
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/json/jwk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def to_key
end
end

private

def rsa?
self[:kty]&.to_sym == :RSA
end
Expand All @@ -64,12 +62,6 @@ def oct?
self[:kty]&.to_sym == :oct
end

def calculate_default_kid
self[:kid] = thumbprint
rescue
# ignore
end

def normalize
case
when rsa?
Expand All @@ -95,6 +87,14 @@ def normalize
end
end

private

def calculate_default_kid
self[:kid] = thumbprint
rescue
# ignore
end

def to_rsa_key
e, n, d, p, q, dp, dq, qi = [:e, :n, :d, :p, :q, :dp, :dq, :qi].collect do |key|
if self[key]
Expand Down

0 comments on commit 24f8b94

Please sign in to comment.