module JsonWebToken::Algorithm::RsaUtil

Load encryption keys

Public Instance Methods

decoded_key(path_to_keys, filename) click to toggle source
# File lib/json_web_token/algorithm/rsa_util.rb, line 18
def decoded_key(path_to_keys, filename)
  OpenSSL::PKey::RSA.new(pem_read(path_to_keys, filename))
end
pem_read(path_to_keys, filename) click to toggle source
# File lib/json_web_token/algorithm/rsa_util.rb, line 22
def pem_read(path_to_keys, filename)
  File.read(File.join(path_to_keys, filename))
end
private_key(path_to_keys, filename = 'private_key.pem') click to toggle source

Load an RSA private key from a pem file

# File lib/json_web_token/algorithm/rsa_util.rb, line 9
def private_key(path_to_keys, filename = 'private_key.pem')
  decoded_key(path_to_keys, filename)
end
public_key(path_to_keys, filename = 'public_key.pem') click to toggle source

Load an RSA public key from a pem file

# File lib/json_web_token/algorithm/rsa_util.rb, line 14
def public_key(path_to_keys, filename = 'public_key.pem')
  decoded_key(path_to_keys, filename)
end