Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Fix for Ruby 2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron authored Apr 16, 2017
1 parent 18f8af2 commit 0963223
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/ostatus2/magic_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ def magic_key_to_pem(magic_key)
_, modulus, exponent = magic_key.split('.')
modulus, exponent = [modulus, exponent].map { |n| decode_base64(n).bytes.inject(0) { |a, e| (a << 8) | e } }

key = OpenSSL::PKey::RSA.new
key.n = modulus
key.e = exponent

key = OpenSSL::PKey::RSA.new
key.set_key(modulus, exponent, key.d)
key.to_pem
end

Expand Down

0 comments on commit 0963223

Please sign in to comment.