Skip to content

Commit 21d270f

Browse files
committed
lib: security keychain
1 parent 92a57bc commit 21d270f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

lib/security/keychain.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
require 'shellwords'
2+
3+
module Security
4+
5+
class Keychain
6+
7+
attr_reader :filename
8+
9+
def initialize(filename)
10+
@filename = filename
11+
end
12+
13+
def info
14+
system %(security show-keychain-info #{@filename.shellescape})
15+
end
16+
17+
class << self
18+
def create(filename, password)
19+
raise NotImplementedError
20+
end
21+
22+
def keychain_from_output(output)
23+
output.split(/\n/).collect { |line| new(line.strip.gsub(/^"|"$/, '')) }
24+
end
25+
end
26+
end
27+
end

0 commit comments

Comments
 (0)