win32-certstore 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3f88b178dce120110256036f506c0643650a851f
4
- data.tar.gz: 26e4d3283456a4e3f4297b5d076df2e1a2f677d5
2
+ SHA256:
3
+ metadata.gz: 64767d805d6d3804ebb5cf74f3b8e0e58fb30d011dc25f1837ce28788268ca70
4
+ data.tar.gz: 909aae7b8937fb0b2b58c3a8b52bd073bfc38fd87e0c5f85a81e383e6530ac6b
5
5
  SHA512:
6
- metadata.gz: 2768217e40d97a78ca9c0f393ac1afe154e14f833a7f549fcb7b478ffab5666a2c051df349bbceb9ce32810863d1a366760f4b397097c2a5b9ee52fb1bf7a9f4
7
- data.tar.gz: 853495d9d5334d56b268fa34d9b3b4c9e5afa3bf913f7b817b67aec6e5c40516ff17b4060ec63da94eec7f97ffc6dc253006a6596f86d57acb88342fa2d605f2
6
+ metadata.gz: 468fce72a67383b7f637c28e13121ee2dbdeca97f098172a5105187e90cee799e7b161f12c3bfda750414a45a3021b56885302acb57d3bb1e96739b58e691f79
7
+ data.tar.gz: f74cb671edfb4a0b4c5743e04e0a8b572c5179724f26295cb24a63a7350833da88600fdd787b1f27f23851a0355a1a53caa45869d43f851aafb486b9739a9a0c
data/README.md CHANGED
@@ -1,225 +1,228 @@
1
- # win32-certstore
2
- Ruby library for accessing the certificate store on Microsoft Windows:
3
-
4
- ## Subcommands
5
-
6
- This library provides the following features.
7
-
8
- ### Open certificate store
9
-
10
- Any valid certificate store can be opened in two ways:
11
-
12
- ```
13
- Win32::Certstore.open("Root") do |store|
14
- //your code should be here!
15
- end
16
- ```
17
-
18
- or
19
-
20
- ```
21
- store = Win32::Certstore.open("Root")
22
- ```
23
-
24
- ### Add certificate
25
-
26
- This method adds a new certificate to an open certificate store.
27
-
28
- ```
29
- Input - Certificate Object (OpenSSL::X509)
30
- Return - True/False
31
- ```
32
-
33
- **Notes: The certificate must be passed as an `OpenSSL::X509` object.**
34
-
35
- ```
36
- raw = File.read "C:\GlobalSignRootCA.pem"
37
- certificate_object = OpenSSL::X509::Certificate.new raw
38
-
39
- Win32::Certstore.open('Root') do |store|
40
- store.add(certificate_object)
41
- end
42
- ```
43
-
44
- or
45
-
46
- ```
47
- raw = File.read "C:\GlobalSignRootCA.pem"
48
- certificate_object = OpenSSL::X509::Certificate.new raw
49
-
50
- store = Win32::Certstore.open('Root')
51
- store.add(certificate_object)
52
- store.close
53
- ```
54
-
55
- ### Get certificate
56
-
57
- Gets a certificate from an open certificate store and returns it as an `OpenSSL::X509` object.
58
-
59
- ```
60
- Input - Certificate thumbprint
61
- Return - Certificate Object (OpenSSL::X509)
62
- ```
63
-
64
- ```
65
- Win32::Certstore.open("Root") do |store|
66
- store.get(certificate_thumbprint)
67
- end
68
- ```
69
-
70
- or
71
-
72
- ```
73
- store = Win32::Certstore.open("Root")
74
- store.get(certificate_thumbprint)
75
- store.close
76
- ```
77
-
78
- ### List certificates
79
-
80
- Lists all certificates in a certificate store.
81
-
82
- ```
83
- Input - NA
84
- Return - Certificate List in JSON format.
85
- ```
86
-
87
- ```
88
- Win32::Certstore.open("Root") do |store|
89
- store.list
90
- end
91
- ```
92
-
93
- or
94
-
95
- ```
96
- store = Win32::Certstore.open("Root")
97
- store.list
98
- store.close
99
- ```
100
-
101
- ### Delete certificate
102
-
103
- Deletes a certificate from a certificate store.
104
-
105
- ```
106
- Input - Certificate thumbprint
107
- Return - True/False
108
- ```
109
-
110
- ```
111
- Win32::Certstore.open("Root") do |store|
112
- store.delete(certificate_thumbprint)
113
- end
114
- ```
115
-
116
- or
117
-
118
- ```
119
- store = Win32::Certstore.open("Root")
120
- store.delete(certificate_thumbprint)
121
- store.close
122
- ```
123
-
124
- ### Search certificate
125
-
126
- Searches for a certificate in an open certificate store.
127
-
128
- ```
129
- Input - Search Token as: Comman name, Friendly name, RDN and other attributes
130
- Return - Matching certificate list
131
- ```
132
-
133
- ```
134
- Win32::Certstore.open("Root") do |store|
135
- store.search(search_token)
136
- end
137
- ```
138
-
139
- or
140
-
141
- ```
142
- store = Win32::Certstore.open("Root")
143
- store.search(search_token)
144
- store.close
145
- ```
146
-
147
- ### Validate certificate
148
-
149
- Validates a certificate in a certificate store on the basis of time validity.
150
-
151
- ```
152
- Input - Certificate thumbprint
153
- Return - True/False
154
-
155
- ```
156
-
157
- ```
158
- Win32::Certstore.open("Root") do |store|
159
- store.valid?(certificate_thumbprint)
160
- end
161
- ```
162
-
163
- or
164
-
165
- ```
166
- store = Win32::Certstore.open("Root")
167
- store.valid?(certificate_thumbprint)
168
- store.close
169
- ```
170
-
171
- ### Performing multiple operations
172
-
173
- To perform more than one operations with single certificate store object
174
-
175
- ```
176
- raw = File.read "C:\GlobalSignRootCA.pem"
177
- certificate_object = OpenSSL::X509::Certificate.new raw
178
-
179
- Win32::Certstore.open('Root') do |store|
180
- store.add(certificate_object)
181
- store.list
182
- end
183
- ```
184
-
185
- or
186
-
187
- ```
188
- raw = File.read "C:\GlobalSignRootCA.pem"
189
- certificate_object = OpenSSL::X509::Certificate.new raw
190
-
191
- store = Win32::Certstore.open('Root')
192
- store.add(certificate_object)
193
- store.list
194
- store.close
195
- ```
196
-
197
- ## Requirements / setup
198
-
199
- ### Ruby
200
-
201
- Ruby 1.9.3+ is required.
202
-
203
- ## CONTRIBUTING:
204
-
205
- Please file bugs against the WIN32-CERTSTORE project at https://github.com/chef/win32-certstore/issues.
206
-
207
- More information on the contribution process for Chef projects can be found in the [Chef Contributions document](http://docs.chef.io/community_contributions.html).
208
-
209
- # LICENSE:
210
-
211
- Author:: Bryan McLellan (<btm@chef.io>)
212
- Copyright:: 2017-2018 Chef Software, Inc.
213
- License:: Apache License, Version 2.0
214
-
215
- Licensed under the Apache License, Version 2.0 (the "License");
216
- you may not use this file except in compliance with the License.
217
- You may obtain a copy of the License at
218
-
219
- http://www.apache.org/licenses/LICENSE-2.0
220
-
221
- Unless required by applicable law or agreed to in writing, software
222
- distributed under the License is distributed on an "AS IS" BASIS,
223
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
- See the License for the specific language governing permissions and
225
- limitations under the License.
1
+ # win32-certstore
2
+ [![Build Status](https://travis-ci.org/chef/win32-certstore.svg?branch=master)](https://travis-ci.org/chef/win32-certstore)
3
+ [![Gem Version](https://badge.fury.io/rb/win32-certstore.svg)](https://badge.fury.io/rb/win32-certstore)
4
+
5
+ Ruby library for accessing the certificate store on Microsoft Windows:
6
+
7
+ ## Subcommands
8
+
9
+ This library provides the following features.
10
+
11
+ ### Open certificate store
12
+
13
+ Any valid certificate store can be opened in two ways:
14
+
15
+ ```
16
+ Win32::Certstore.open("Root") do |store|
17
+ //your code should be here!
18
+ end
19
+ ```
20
+
21
+ or
22
+
23
+ ```
24
+ store = Win32::Certstore.open("Root")
25
+ ```
26
+
27
+ ### Add certificate
28
+
29
+ This method adds a new certificate to an open certificate store.
30
+
31
+ ```
32
+ Input - Certificate Object (OpenSSL::X509)
33
+ Return - True/False
34
+ ```
35
+
36
+ **Notes: The certificate must be passed as an `OpenSSL::X509` object.**
37
+
38
+ ```
39
+ raw = File.read "C:\GlobalSignRootCA.pem"
40
+ certificate_object = OpenSSL::X509::Certificate.new raw
41
+
42
+ Win32::Certstore.open('Root') do |store|
43
+ store.add(certificate_object)
44
+ end
45
+ ```
46
+
47
+ or
48
+
49
+ ```
50
+ raw = File.read "C:\GlobalSignRootCA.pem"
51
+ certificate_object = OpenSSL::X509::Certificate.new raw
52
+
53
+ store = Win32::Certstore.open('Root')
54
+ store.add(certificate_object)
55
+ store.close
56
+ ```
57
+
58
+ ### Get certificate
59
+
60
+ Gets a certificate from an open certificate store and returns it as an `OpenSSL::X509` object.
61
+
62
+ ```
63
+ Input - Certificate thumbprint
64
+ Return - Certificate Object (OpenSSL::X509)
65
+ ```
66
+
67
+ ```
68
+ Win32::Certstore.open("Root") do |store|
69
+ store.get(certificate_thumbprint)
70
+ end
71
+ ```
72
+
73
+ or
74
+
75
+ ```
76
+ store = Win32::Certstore.open("Root")
77
+ store.get(certificate_thumbprint)
78
+ store.close
79
+ ```
80
+
81
+ ### List certificates
82
+
83
+ Lists all certificates in a certificate store.
84
+
85
+ ```
86
+ Input - NA
87
+ Return - Certificate List in JSON format.
88
+ ```
89
+
90
+ ```
91
+ Win32::Certstore.open("Root") do |store|
92
+ store.list
93
+ end
94
+ ```
95
+
96
+ or
97
+
98
+ ```
99
+ store = Win32::Certstore.open("Root")
100
+ store.list
101
+ store.close
102
+ ```
103
+
104
+ ### Delete certificate
105
+
106
+ Deletes a certificate from a certificate store.
107
+
108
+ ```
109
+ Input - Certificate thumbprint
110
+ Return - True/False
111
+ ```
112
+
113
+ ```
114
+ Win32::Certstore.open("Root") do |store|
115
+ store.delete(certificate_thumbprint)
116
+ end
117
+ ```
118
+
119
+ or
120
+
121
+ ```
122
+ store = Win32::Certstore.open("Root")
123
+ store.delete(certificate_thumbprint)
124
+ store.close
125
+ ```
126
+
127
+ ### Search certificate
128
+
129
+ Searches for a certificate in an open certificate store.
130
+
131
+ ```
132
+ Input - Search Token as: Comman name, Friendly name, RDN and other attributes
133
+ Return - Matching certificate list
134
+ ```
135
+
136
+ ```
137
+ Win32::Certstore.open("Root") do |store|
138
+ store.search(search_token)
139
+ end
140
+ ```
141
+
142
+ or
143
+
144
+ ```
145
+ store = Win32::Certstore.open("Root")
146
+ store.search(search_token)
147
+ store.close
148
+ ```
149
+
150
+ ### Validate certificate
151
+
152
+ Validates a certificate in a certificate store on the basis of time validity.
153
+
154
+ ```
155
+ Input - Certificate thumbprint
156
+ Return - True/False
157
+
158
+ ```
159
+
160
+ ```
161
+ Win32::Certstore.open("Root") do |store|
162
+ store.valid?(certificate_thumbprint)
163
+ end
164
+ ```
165
+
166
+ or
167
+
168
+ ```
169
+ store = Win32::Certstore.open("Root")
170
+ store.valid?(certificate_thumbprint)
171
+ store.close
172
+ ```
173
+
174
+ ### Performing multiple operations
175
+
176
+ To perform more than one operations with single certificate store object
177
+
178
+ ```
179
+ raw = File.read "C:\GlobalSignRootCA.pem"
180
+ certificate_object = OpenSSL::X509::Certificate.new raw
181
+
182
+ Win32::Certstore.open('Root') do |store|
183
+ store.add(certificate_object)
184
+ store.list
185
+ end
186
+ ```
187
+
188
+ or
189
+
190
+ ```
191
+ raw = File.read "C:\GlobalSignRootCA.pem"
192
+ certificate_object = OpenSSL::X509::Certificate.new raw
193
+
194
+ store = Win32::Certstore.open('Root')
195
+ store.add(certificate_object)
196
+ store.list
197
+ store.close
198
+ ```
199
+
200
+ ## Requirements / setup
201
+
202
+ ### Ruby
203
+
204
+ Ruby 1.9.3+ is required.
205
+
206
+ ## CONTRIBUTING:
207
+
208
+ Please file bugs against the WIN32-CERTSTORE project at https://github.com/chef/win32-certstore/issues.
209
+
210
+ More information on the contribution process for Chef projects can be found in the [Chef Contributions document](http://docs.chef.io/community_contributions.html).
211
+
212
+ # LICENSE:
213
+
214
+ Author:: Bryan McLellan (<btm@chef.io>)
215
+ Copyright:: 2017-2018 Chef Software, Inc.
216
+ License:: Apache License, Version 2.0
217
+
218
+ Licensed under the Apache License, Version 2.0 (the "License");
219
+ you may not use this file except in compliance with the License.
220
+ You may obtain a copy of the License at
221
+
222
+ http://www.apache.org/licenses/LICENSE-2.0
223
+
224
+ Unless required by applicable law or agreed to in writing, software
225
+ distributed under the License is distributed on an "AS IS" BASIS,
226
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
227
+ See the License for the specific language governing permissions and
228
+ limitations under the License.