Permalink
Browse files

Merge pull request #26 from jherdman/patch-1

Handle Keys When They Are a Pathname
  • Loading branch information...
2 parents 274453f + f5f9c01 commit 7dc97d3a934550da5885475a5f6710e879bb6786 @spikex committed Sep 19, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/strongbox/lock.rb
View
4 lib/strongbox/lock.rb
@@ -143,7 +143,9 @@ def get_rsa_key(key,password = '')
return key if key.is_a?(OpenSSL::PKey::RSA)
- if key !~ /^-+BEGIN .* KEY-+$/
+ if key.respond_to?(:read)
+ key = key.read
+ elsif key !~ /^-+BEGIN .* KEY-+$/
key = File.read(key)
end
return OpenSSL::PKey::RSA.new(key,password)

0 comments on commit 7dc97d3

Please sign in to comment.