keyring 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -0
- data/README.md +24 -14
- data/ext/mkrf_conf.rb +7 -0
- data/keyring.gemspec +1 -3
- data/lib/keyring/backends/macosx_keychain.rb +50 -72
- data/lib/keyring/version.rb +1 -1
- data/test/test_backend_macosx_keychain.rb +47 -64
- metadata +2 -22
- data/test/testcmds/macosx/binary +0 -1
- data/test/testcmds/macosx/emptything +0 -1
- data/test/testcmds/macosx/random +0 -1
- data/test/testcmds/macosx/security-delete +0 -27
- data/test/testcmds/macosx/security-find +0 -26
- data/test/testcmds/macosx/security-findempty +0 -26
- data/test/testcmds/macosx/security-findhex +0 -26
- data/test/testcmds/macosx/security-notfound +0 -6
- data/test/testcmds/macosx/security-righthelp +0 -51
- data/test/testcmds/macosx/security-wronghelp +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d59fdf205915208c45349154db548ac71a6162f5
|
4
|
+
data.tar.gz: 2715a0cbc8bf7f24a2f11322af70d2ee70857dc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab83ae87c6128614d1a47581d4ea725479bcf719a1644c6ac20dbcfa9164d7ac6e5ea357d5b2262fea75df9179c91bc2418cdd81e57664ca8d2a1e6fe6bc5473
|
7
|
+
data.tar.gz: bdb3d3d9a482b9f5a2b463685ad430f673078ce59813f096d1fd81cec3e06c1d1b2a9021404a120459ae87a15f911c44cd16b604ba9088f2d612238e8732f8c5
|
data/Gemfile
CHANGED
@@ -5,3 +5,13 @@ source 'https://rubygems.org'
|
|
5
5
|
|
6
6
|
# Specify your gem's dependencies in keyring.gemspec
|
7
7
|
gemspec
|
8
|
+
|
9
|
+
# Duplicated contents of ext/mkrf_conf.rb here - afaict, the
|
10
|
+
# spec.extensions stuff in the gemspec file doesn't run on a
|
11
|
+
# bundle install
|
12
|
+
|
13
|
+
gem 'ruby-keychain', '~> 0.3.2'
|
14
|
+
|
15
|
+
group :test, :development do
|
16
|
+
gem 'test-unit'
|
17
|
+
end
|
data/README.md
CHANGED
@@ -20,33 +20,43 @@ Additional keyring services we'd like to support:
|
|
20
20
|
|
21
21
|
Add this line to your application's Gemfile:
|
22
22
|
|
23
|
-
|
23
|
+
```ruby
|
24
|
+
gem 'keyring'
|
25
|
+
```
|
24
26
|
|
25
27
|
And then execute:
|
26
28
|
|
27
|
-
|
29
|
+
```shell
|
30
|
+
$ bundle
|
31
|
+
```
|
28
32
|
|
29
33
|
Or install it yourself as:
|
30
34
|
|
31
|
-
|
35
|
+
```shell
|
36
|
+
$ gem install keyring
|
37
|
+
```
|
32
38
|
|
33
39
|
## Usage
|
34
40
|
|
35
|
-
The basic usage of keyring is simple: just call Keyring#set_password and
|
36
|
-
Keyring#get_password
|
41
|
+
The basic usage of keyring is simple: just call `Keyring#set_password` and
|
42
|
+
`Keyring#get_password`:
|
37
43
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
44
|
+
```ruby
|
45
|
+
require 'keyring'
|
46
|
+
keyring = Keyring.new
|
47
|
+
keyring.set_password('service', 'username', 'password')
|
48
|
+
password = keyring.get_password('service', 'username')
|
49
|
+
keyring.delete_password('service', 'username')
|
50
|
+
```
|
43
51
|
|
44
|
-
'service' is an arbitrary string identifying your application.
|
52
|
+
`'service'` is an arbitrary string identifying your application.
|
45
53
|
|
46
54
|
By default keyring will attempt to pick the best backend supported on your system. You can specify a particular backend:
|
47
55
|
|
48
|
-
|
49
|
-
|
56
|
+
```ruby
|
57
|
+
require 'keyring'
|
58
|
+
keyring = Keyring.new(Keyring::Backend::Memory.new)
|
59
|
+
```
|
50
60
|
|
51
61
|
## Platform notes
|
52
62
|
|
@@ -56,7 +66,7 @@ requires the introspection bindings to be installed (as well as gnome-keyring).
|
|
56
66
|
|
57
67
|
## Credits
|
58
68
|
|
59
|
-
Copyright 2013-
|
69
|
+
Copyright 2013-2016, Jason Heiss, wvengen, jtopper
|
60
70
|
|
61
71
|
Inspired by the keyring library for Python:
|
62
72
|
https://bitbucket.org/kang/python-keyring-lib
|
data/ext/mkrf_conf.rb
CHANGED
@@ -9,10 +9,17 @@ rescue NoMethodError
|
|
9
9
|
end
|
10
10
|
inst = Gem::DependencyInstaller.new
|
11
11
|
begin
|
12
|
+
|
12
13
|
if RUBY_PLATFORM =~ /linux/
|
13
14
|
warn "*linux: installing gir_ffi-gnome_keyring..."
|
14
15
|
inst.install "gir_ffi-gnome_keyring", '~> 0.0.3'
|
15
16
|
end
|
17
|
+
|
18
|
+
if RUBY_PLATFORM =~ /darwin10/
|
19
|
+
warn '*osx: installing ruby-keychain'
|
20
|
+
inst.install 'ruby-keychain', '~> 0.3.2'
|
21
|
+
end
|
22
|
+
|
16
23
|
rescue
|
17
24
|
exit(1)
|
18
25
|
end
|
data/keyring.gemspec
CHANGED
@@ -4,92 +4,70 @@
|
|
4
4
|
# This is a keyring backend for the Apple Keychain
|
5
5
|
# http://en.wikipedia.org/wiki/Keychain_(Apple)
|
6
6
|
|
7
|
-
# Consider switching to ruby-keychain gem to avoid password in command line
|
8
|
-
# https://rubygems.org/gems/ruby-keychain
|
9
|
-
# https://github.com/fcheung/keychain
|
10
|
-
|
11
|
-
require 'open3'
|
12
|
-
|
13
7
|
class Keyring::Backend::MacosxKeychain < Keyring::Backend
|
8
|
+
|
14
9
|
register_implementation(self)
|
15
|
-
|
16
|
-
attr_accessor :security
|
10
|
+
|
17
11
|
def initialize
|
18
|
-
|
12
|
+
require 'keychain'
|
13
|
+
rescue LoadError
|
19
14
|
end
|
15
|
+
|
20
16
|
def supported?
|
21
|
-
|
17
|
+
defined?(::Keychain) && true
|
22
18
|
end
|
19
|
+
|
23
20
|
def priority
|
24
21
|
1
|
25
22
|
end
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
|
24
|
+
# NB: Uses default keychain for everything.
|
25
|
+
# This is consistent with the GnomeKeyring implementation
|
26
|
+
# No mechanism is provided in the API to support alternative
|
27
|
+
# keyring files.
|
30
28
|
|
31
29
|
def set_password(service, username, password)
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
30
|
+
|
31
|
+
Keychain.generic_passwords.create(
|
32
|
+
:service => service,
|
33
|
+
:password => password,
|
34
|
+
:account => username,
|
35
|
+
)
|
36
|
+
|
37
|
+
return true
|
38
|
+
|
39
|
+
rescue Keychain::Error
|
40
|
+
return false
|
41
|
+
rescue KeychainDuplicateItemError
|
42
|
+
return true
|
45
43
|
end
|
44
|
+
|
46
45
|
def get_password(service, username)
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
if line =~ /\Apassword: (.*)/
|
59
|
-
pw = $1
|
60
|
-
if pw == ''
|
61
|
-
password = pw
|
62
|
-
elsif pw =~ /\A"(.*)"\z/
|
63
|
-
password = $1
|
64
|
-
elsif pw =~ /\A0x(\h+)/
|
65
|
-
password = [$1].pack("H*")
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
# security exits with 44 if the entry does not exist. We just want to return
|
70
|
-
# nil rather than raise an exception in that case.
|
71
|
-
if ![0,44].include?(wait_thr.value.exitstatus)
|
72
|
-
raise
|
73
|
-
end
|
74
|
-
end
|
75
|
-
password
|
46
|
+
|
47
|
+
scope = Keychain.generic_passwords.where(
|
48
|
+
:service => service,
|
49
|
+
:account => username,
|
50
|
+
)
|
51
|
+
|
52
|
+
return false if scope.nil?
|
53
|
+
return false if scope.first.nil?
|
54
|
+
|
55
|
+
scope.first.password
|
56
|
+
|
76
57
|
end
|
58
|
+
|
77
59
|
def delete_password(service, username)
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
return false
|
90
|
-
else
|
91
|
-
raise
|
92
|
-
end
|
93
|
-
end
|
60
|
+
|
61
|
+
scope = Keychain.generic_passwords.where(
|
62
|
+
:service => service,
|
63
|
+
:account => username,
|
64
|
+
)
|
65
|
+
|
66
|
+
return false if scope.nil?
|
67
|
+
return false if scope.first.nil?
|
68
|
+
|
69
|
+
scope.first.delete
|
70
|
+
|
94
71
|
end
|
72
|
+
|
95
73
|
end
|
data/lib/keyring/version.rb
CHANGED
@@ -1,73 +1,56 @@
|
|
1
1
|
# keyring: System keyring abstraction library
|
2
2
|
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
3
3
|
|
4
|
-
require
|
4
|
+
# These tests require Gnome Keyring to be installed and are skipped otherwise
|
5
|
+
|
5
6
|
require 'test/unit'
|
6
7
|
require 'mocha/setup'
|
7
8
|
require 'keyring'
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
'
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
def test_get_password_empty
|
52
|
-
@backend.security = File.join(TESTCMDDIR, 'macosx/security-findempty')
|
53
|
-
assert_equal '', @backend.get_password('service', 'emptyuser')
|
54
|
-
end
|
55
|
-
def test_get_password_notfound
|
56
|
-
@backend.security = File.join(TESTCMDDIR, 'macosx/security-notfound')
|
57
|
-
assert_nil @backend.get_password('bogus', 'bogus')
|
58
|
-
end
|
59
|
-
|
60
|
-
def test_delete_password_options
|
61
|
-
Open3.expects(:popen3).with(
|
62
|
-
'/usr/bin/security', 'delete-generic-password', '-s', 'service', '-a', 'username')
|
63
|
-
@backend.delete_password('service', 'username')
|
64
|
-
end
|
65
|
-
def test_delete_password_output
|
66
|
-
@backend.security = File.join(TESTCMDDIR, 'macosx/security-delete')
|
67
|
-
assert @backend.delete_password('service', 'gooduser')
|
68
|
-
end
|
69
|
-
def test_delete_password_errors
|
70
|
-
@backend.security = File.join(TESTCMDDIR, 'macosx/security-notfound')
|
71
|
-
refute @backend.delete_password('bogus', 'bogus')
|
10
|
+
begin
|
11
|
+
require 'keychain'
|
12
|
+
|
13
|
+
class KeyringBackendMacosxKeychainTests < Test::Unit::TestCase
|
14
|
+
|
15
|
+
def setup
|
16
|
+
@backend = Keyring::Backend::MacosxKeychain.new
|
17
|
+
@backend.delete_password('KeyringBackendMacosxKeychainTests', 'username')
|
18
|
+
end
|
19
|
+
|
20
|
+
def teardown
|
21
|
+
@backend.delete_password('KeyringBackendMacosxKeychainTests', 'username')
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_supported
|
25
|
+
assert @backend.supported?
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_priority
|
29
|
+
assert_equal 1, @backend.priority
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_no_default_password
|
33
|
+
refute @backend.get_password('KeyringBackendMacosxKeychainTests', 'username')
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_set_password
|
37
|
+
@backend.set_password('KeyringBackendMacosxKeychainTests', 'username', 'password')
|
38
|
+
assert_equal 'password', @backend.get_password('KeyringBackendMacosxKeychainTests', 'username')
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_delete_nonexistent_password
|
42
|
+
refute @backend.delete_password('KeyringBackendMacosxKeychainTests', 'username')
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_delete_existing_password
|
46
|
+
@backend.set_password('KeyringBackendMacosxKeychainTests', 'username', 'password')
|
47
|
+
@backend.delete_password('KeyringBackendMacosxKeychainTests', 'username')
|
48
|
+
refute @backend.get_password('KeyringBackendMacosxKeychainTests', 'username')
|
49
|
+
end
|
50
|
+
|
72
51
|
end
|
52
|
+
|
53
|
+
|
54
|
+
rescue LoadError
|
55
|
+
puts "Skipping MacosxKeychain tests because the native bindings could not be loaded."
|
73
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keyring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Heiss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -99,16 +99,6 @@ files:
|
|
99
99
|
- test/test_backend_memory.rb
|
100
100
|
- test/test_cli.rb
|
101
101
|
- test/test_keyring.rb
|
102
|
-
- test/testcmds/macosx/binary
|
103
|
-
- test/testcmds/macosx/emptything
|
104
|
-
- test/testcmds/macosx/random
|
105
|
-
- test/testcmds/macosx/security-delete
|
106
|
-
- test/testcmds/macosx/security-find
|
107
|
-
- test/testcmds/macosx/security-findempty
|
108
|
-
- test/testcmds/macosx/security-findhex
|
109
|
-
- test/testcmds/macosx/security-notfound
|
110
|
-
- test/testcmds/macosx/security-righthelp
|
111
|
-
- test/testcmds/macosx/security-wronghelp
|
112
102
|
homepage: https://github.com/jheiss/keyring
|
113
103
|
licenses:
|
114
104
|
- MIT
|
@@ -141,13 +131,3 @@ test_files:
|
|
141
131
|
- test/test_backend_memory.rb
|
142
132
|
- test/test_cli.rb
|
143
133
|
- test/test_keyring.rb
|
144
|
-
- test/testcmds/macosx/binary
|
145
|
-
- test/testcmds/macosx/emptything
|
146
|
-
- test/testcmds/macosx/random
|
147
|
-
- test/testcmds/macosx/security-delete
|
148
|
-
- test/testcmds/macosx/security-find
|
149
|
-
- test/testcmds/macosx/security-findempty
|
150
|
-
- test/testcmds/macosx/security-findhex
|
151
|
-
- test/testcmds/macosx/security-notfound
|
152
|
-
- test/testcmds/macosx/security-righthelp
|
153
|
-
- test/testcmds/macosx/security-wronghelp
|
data/test/testcmds/macosx/binary
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
01010101
|
@@ -1 +0,0 @@
|
|
1
|
-
password:
|
data/test/testcmds/macosx/random
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ô%A���t;. u�@r
|
@@ -1,27 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
# keyring: System keyring abstraction library
|
3
|
-
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
4
|
-
|
5
|
-
cat <<-EOF
|
6
|
-
keychain: "/Users/jheiss/Library/Keychains/login.keychain"
|
7
|
-
class: "genp"
|
8
|
-
attributes:
|
9
|
-
0x00000007 <blob>="service"
|
10
|
-
0x00000008 <blob>=<NULL>
|
11
|
-
"acct"<blob>="username"
|
12
|
-
"cdat"<timedate>=0x32303133313132303233353532395A00 "20131120235529Z\000"
|
13
|
-
"crtr"<uint32>=<NULL>
|
14
|
-
"cusi"<sint32>=<NULL>
|
15
|
-
"desc"<blob>=<NULL>
|
16
|
-
"gena"<blob>=<NULL>
|
17
|
-
"icmt"<blob>=<NULL>
|
18
|
-
"invi"<sint32>=<NULL>
|
19
|
-
"mdat"<timedate>=0x32303133313132313232353534395A00 "20131121225549Z\000"
|
20
|
-
"nega"<sint32>=<NULL>
|
21
|
-
"prot"<blob>=<NULL>
|
22
|
-
"scrp"<sint32>=<NULL>
|
23
|
-
"svce"<blob>="service"
|
24
|
-
"type"<uint32>=<NULL>
|
25
|
-
EOF
|
26
|
-
|
27
|
-
printf "password has been deleted.\n" >&2
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
# keyring: System keyring abstraction library
|
3
|
-
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
4
|
-
|
5
|
-
cat <<-EOF
|
6
|
-
keychain: "/Users/example/Library/Keychains/login.keychain"
|
7
|
-
class: "genp"
|
8
|
-
attributes:
|
9
|
-
0x00000007 <blob>="service"
|
10
|
-
0x00000008 <blob>=<NULL>
|
11
|
-
"acct"<blob>="username"
|
12
|
-
"cdat"<timedate>=0x32303133313132303233353532395A00 "20131120235529Z\000"
|
13
|
-
"crtr"<uint32>=<NULL>
|
14
|
-
"cusi"<sint32>=<NULL>
|
15
|
-
"desc"<blob>=<NULL>
|
16
|
-
"gena"<blob>=<NULL>
|
17
|
-
"icmt"<blob>=<NULL>
|
18
|
-
"invi"<sint32>=<NULL>
|
19
|
-
"mdat"<timedate>=0x32303133313132313132343834315A00 "20131121124841Z\000"
|
20
|
-
"nega"<sint32>=<NULL>
|
21
|
-
"prot"<blob>=<NULL>
|
22
|
-
"scrp"<sint32>=<NULL>
|
23
|
-
"svce"<blob>="service"
|
24
|
-
"type"<uint32>=<NULL>
|
25
|
-
EOF
|
26
|
-
printf "password: \"password\"\n" >&2
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
# keyring: System keyring abstraction library
|
3
|
-
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
4
|
-
|
5
|
-
cat <<-EOF
|
6
|
-
keychain: "/Users/example/Library/Keychains/login.keychain"
|
7
|
-
class: "genp"
|
8
|
-
attributes:
|
9
|
-
0x00000007 <blob>="service"
|
10
|
-
0x00000008 <blob>=<NULL>
|
11
|
-
"acct"<blob>="emptyuser"
|
12
|
-
"cdat"<timedate>=0x32303133313132303233353532395A00 "20131120235529Z\000"
|
13
|
-
"crtr"<uint32>=<NULL>
|
14
|
-
"cusi"<sint32>=<NULL>
|
15
|
-
"desc"<blob>=<NULL>
|
16
|
-
"gena"<blob>=<NULL>
|
17
|
-
"icmt"<blob>=<NULL>
|
18
|
-
"invi"<sint32>=<NULL>
|
19
|
-
"mdat"<timedate>=0x32303133313132313132343834315A00 "20131121124841Z\000"
|
20
|
-
"nega"<sint32>=<NULL>
|
21
|
-
"prot"<blob>=<NULL>
|
22
|
-
"scrp"<sint32>=<NULL>
|
23
|
-
"svce"<blob>="service"
|
24
|
-
"type"<uint32>=<NULL>
|
25
|
-
EOF
|
26
|
-
printf "password: \n" >&2
|
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
# keyring: System keyring abstraction library
|
3
|
-
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
4
|
-
|
5
|
-
cat <<-EOF
|
6
|
-
keychain: "/Users/example/Library/Keychains/login.keychain"
|
7
|
-
class: "genp"
|
8
|
-
attributes:
|
9
|
-
0x00000007 <blob>="service"
|
10
|
-
0x00000008 <blob>=<NULL>
|
11
|
-
"acct"<blob>="hexuser"
|
12
|
-
"cdat"<timedate>=0x32303133313132303233353532395A00 "20131120235529Z\000"
|
13
|
-
"crtr"<uint32>=<NULL>
|
14
|
-
"cusi"<sint32>=<NULL>
|
15
|
-
"desc"<blob>=<NULL>
|
16
|
-
"gena"<blob>=<NULL>
|
17
|
-
"icmt"<blob>=<NULL>
|
18
|
-
"invi"<sint32>=<NULL>
|
19
|
-
"mdat"<timedate>=0x32303133313132313132343834315A00 "20131121124841Z\000"
|
20
|
-
"nega"<sint32>=<NULL>
|
21
|
-
"prot"<blob>=<NULL>
|
22
|
-
"scrp"<sint32>=<NULL>
|
23
|
-
"svce"<blob>="service"
|
24
|
-
"type"<uint32>=<NULL>
|
25
|
-
EOF
|
26
|
-
printf "password: 0x08300831083008310830083108300831 \"\0100\0101\0100\0101\0100\0101\0100\0101\"\n" >&2
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
# keyring: System keyring abstraction library
|
3
|
-
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
4
|
-
|
5
|
-
# The help output really is indented with spaces like this
|
6
|
-
cat <<-EOF
|
7
|
-
help Show all commands, or show usage for a command.
|
8
|
-
list-keychains Display or manipulate the keychain search list.
|
9
|
-
default-keychain Display or set the default keychain.
|
10
|
-
login-keychain Display or set the login keychain.
|
11
|
-
create-keychain Create keychains and add them to the search list.
|
12
|
-
delete-keychain Delete keychains and remove them from the search list.
|
13
|
-
lock-keychain Lock the specified keychain.
|
14
|
-
unlock-keychain Unlock the specified keychain.
|
15
|
-
set-keychain-settings Set settings for a keychain.
|
16
|
-
set-keychain-password Set password for a keychain.
|
17
|
-
show-keychain-info Show the settings for keychain.
|
18
|
-
dump-keychain Dump the contents of one or more keychains.
|
19
|
-
create-keypair Create an asymmetric key pair.
|
20
|
-
add-generic-password Add a generic password item.
|
21
|
-
add-internet-password Add an internet password item.
|
22
|
-
add-certificates Add certificates to a keychain.
|
23
|
-
find-generic-password Find a generic password item.
|
24
|
-
delete-generic-password Delete a generic password item.
|
25
|
-
find-internet-password Find an internet password item.
|
26
|
-
delete-internet-password Delete an internet password item.
|
27
|
-
find-certificate Find a certificate item.
|
28
|
-
find-identity Find an identity (certificate + private key).
|
29
|
-
delete-certificate Delete a certificate from a keychain.
|
30
|
-
set-identity-preference Set the preferred identity to use for a service.
|
31
|
-
get-identity-preference Get the preferred identity to use for a service.
|
32
|
-
create-db Create a db using the DL.
|
33
|
-
export Export items from a keychain.
|
34
|
-
import Import items into a keychain.
|
35
|
-
cms Encode or decode CMS messages.
|
36
|
-
install-mds Install (or re-install) the MDS database.
|
37
|
-
add-trusted-cert Add trusted certificate(s).
|
38
|
-
remove-trusted-cert Remove trusted certificate(s).
|
39
|
-
dump-trust-settings Display contents of trust settings.
|
40
|
-
user-trust-settings-enable Display or manipulate user-level trust settings.
|
41
|
-
trust-settings-export Export trust settings.
|
42
|
-
trust-settings-import Import trust settings.
|
43
|
-
verify-cert Verify certificate(s).
|
44
|
-
authorize Perform authorization operations.
|
45
|
-
authorizationdb Make changes to the authorization policy database.
|
46
|
-
|
47
|
-
execute-with-privileges Execute tool with privileges.
|
48
|
-
leaks Run /usr/bin/leaks on this process.
|
49
|
-
error Display a descriptive message for the given error code(s).
|
50
|
-
create-filevaultmaster-keychain Create a keychain containing a key pair for FileVault recovery use.
|
51
|
-
EOF
|