r509-validity-redis 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +30 -0
- data/Rakefile +36 -0
- data/doc/Kernel.html +174 -0
- data/doc/R509/Validity/Redis/Checker.html +409 -0
- data/doc/R509/Validity/Redis/Writer.html +556 -0
- data/doc/R509/Validity/Redis.html +129 -0
- data/doc/R509/Validity.html +115 -0
- data/doc/R509.html +115 -0
- data/doc/_index.html +175 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +107 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +107 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +124 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/r509/validity/redis/checker.rb +30 -0
- data/lib/r509/validity/redis/version.rb +7 -0
- data/lib/r509/validity/redis/writer.rb +43 -0
- data/lib/r509/validity/redis.rb +15 -0
- data/spec/checker_spec.rb +68 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/writer_spec.rb +127 -0
- metadata +144 -0
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
This project is related to [r509](http://github.com/reaperhulk/r509) and [ocsp-responder](http://github.com/reaperhulk/ocsp-responder), allowing certificate validity and revocation information to be read and written to a Redis backend.
|
2
|
+
|
3
|
+
When a certificate is issued, we want this sent to Redis:
|
4
|
+
|
5
|
+
HMSET "cert:<serial>" status 0
|
6
|
+
|
7
|
+
When revoked:
|
8
|
+
|
9
|
+
HMSET "cert:<serial>" status 1 revocation_time <timestamp> revocation_reason 0
|
10
|
+
|
11
|
+
|
12
|
+
To get the status of a certificate:
|
13
|
+
|
14
|
+
HGETALL "cert:<serial>"
|
15
|
+
|
16
|
+
The "status" field can be one of:
|
17
|
+
|
18
|
+
R509::Validity::VALID
|
19
|
+
R509::Validity::REVOKED
|
20
|
+
|
21
|
+
The "revocation_reason" field can be one of:
|
22
|
+
|
23
|
+
I don't know, we should probably find out
|
24
|
+
|
25
|
+
Use this in a project like ocsp-responder by passing it into R509::Ocsp::Signer's constructor:
|
26
|
+
|
27
|
+
R509::Ocsp::Signer.new(
|
28
|
+
:validity_checker => R509::Validity::Redis::Checker.new(Redis.new)
|
29
|
+
)
|
30
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
require "#{File.dirname(__FILE__)}/lib/r509/validity/redis/version"
|
4
|
+
|
5
|
+
task :default => :spec
|
6
|
+
RSpec::Core::RakeTask.new(:spec)
|
7
|
+
|
8
|
+
desc 'Run all rspec tests with rcov (1.8 only)'
|
9
|
+
RSpec::Core::RakeTask.new(:rcov) do |t|
|
10
|
+
t.rcov_opts = %q[--exclude "spec,gems"]
|
11
|
+
t.rcov = true
|
12
|
+
end
|
13
|
+
|
14
|
+
namespace :gem do
|
15
|
+
desc 'Build the gem'
|
16
|
+
task :build do
|
17
|
+
puts `yard`
|
18
|
+
puts `gem build r509-validity-redis.gemspec`
|
19
|
+
end
|
20
|
+
|
21
|
+
desc 'Install gem'
|
22
|
+
task :install do
|
23
|
+
puts `gem install r509-validity-redis-#{R509::Validity::Redis::VERSION}.gem`
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Uninstall gem'
|
27
|
+
task :uninstall do
|
28
|
+
puts `gem uninstall r509-validity-redis`
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'Build yard documentation'
|
33
|
+
task :yard do
|
34
|
+
puts `yard`
|
35
|
+
`open doc/index.html`
|
36
|
+
end
|
data/doc/Kernel.html
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Kernel
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '';
|
20
|
+
framesUrl = "frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="_index.html">Index (K)</a> »
|
35
|
+
|
36
|
+
|
37
|
+
<span class="title">Kernel</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Kernel
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
82
|
+
<dd class="r1 last">lib/r509/validity/redis.rb</dd>
|
83
|
+
|
84
|
+
</dl>
|
85
|
+
<div class="clear"></div>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<h2>
|
96
|
+
Instance Method Summary
|
97
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
98
|
+
</h2>
|
99
|
+
|
100
|
+
<ul class="summary">
|
101
|
+
|
102
|
+
<li class="public ">
|
103
|
+
<span class="summary_signature">
|
104
|
+
|
105
|
+
<a href="#require_relative-instance_method" title="#require_relative (instance method)">- (Object) <strong>require_relative</strong>(path) </a>
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
</span>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
120
|
+
|
121
|
+
</li>
|
122
|
+
|
123
|
+
|
124
|
+
</ul>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<div id="instance_method_details" class="method_details_list">
|
130
|
+
<h2>Instance Method Details</h2>
|
131
|
+
|
132
|
+
|
133
|
+
<div class="method_details first">
|
134
|
+
<h3 class="signature first" id="require_relative-instance_method">
|
135
|
+
|
136
|
+
- (<tt>Object</tt>) <strong>require_relative</strong>(path)
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</h3><table class="source_code">
|
143
|
+
<tr>
|
144
|
+
<td>
|
145
|
+
<pre class="lines">
|
146
|
+
|
147
|
+
|
148
|
+
5
|
149
|
+
6
|
150
|
+
7</pre>
|
151
|
+
</td>
|
152
|
+
<td>
|
153
|
+
<pre class="code"><span class="info file"># File 'lib/r509/validity/redis.rb', line 5</span>
|
154
|
+
|
155
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_require_relative'>require_relative</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
|
156
|
+
<span class='id identifier rubyid_require'>require</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='id identifier rubyid_caller'>caller</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_to_str'>to_str</span><span class='rparen'>)</span>
|
157
|
+
<span class='kw'>end</span></pre>
|
158
|
+
</td>
|
159
|
+
</tr>
|
160
|
+
</table>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div id="footer">
|
168
|
+
Generated on Mon Oct 15 10:51:03 2012 by
|
169
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
170
|
+
0.8.2.1 (ruby-1.9.3).
|
171
|
+
</div>
|
172
|
+
|
173
|
+
</body>
|
174
|
+
</html>
|
@@ -0,0 +1,409 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Class: R509::Validity::Redis::Checker
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.2.1
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../../';
|
20
|
+
framesUrl = "../../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../../_index.html">Index (C)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../../R509.html" title="R509 (module)">R509</a></span></span> » <span class='title'><span class='object_link'><a href="../../Validity.html" title="R509::Validity (module)">Validity</a></span></span> » <span class='title'><span class='object_link'><a href="../Redis.html" title="R509::Validity::Redis (module)">Redis</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Checker</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: R509::Validity::Redis::Checker
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName">Checker</span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next">Checker</li>
|
82
|
+
|
83
|
+
<li class="next">R509::Validity::Redis::Checker</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/r509/validity/redis/checker.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#check-instance_method" title="#check (instance method)">- (R509::Validity::Status) <strong>check</strong>(issuer, serial) </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
<li class="public ">
|
142
|
+
<span class="summary_signature">
|
143
|
+
|
144
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Checker) <strong>initialize</strong>(redis) </a>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
</span>
|
149
|
+
|
150
|
+
|
151
|
+
<span class="note title constructor">constructor</span>
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<span class="summary_desc"><div class='inline'>
|
161
|
+
<p>A new instance of Checker.</p>
|
162
|
+
</div></span>
|
163
|
+
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="public ">
|
168
|
+
<span class="summary_signature">
|
169
|
+
|
170
|
+
<a href="#is_available%3F-instance_method" title="#is_available? (instance method)">- (Boolean) <strong>is_available?</strong> </a>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
</span>
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
185
|
+
|
186
|
+
</li>
|
187
|
+
|
188
|
+
|
189
|
+
</ul>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<div id="constructor_details" class="method_details_list">
|
194
|
+
<h2>Constructor Details</h2>
|
195
|
+
|
196
|
+
<div class="method_details first">
|
197
|
+
<h3 class="signature first" id="initialize-instance_method">
|
198
|
+
|
199
|
+
- (<tt><span class='object_link'><a href="" title="R509::Validity::Redis::Checker (class)">Checker</a></span></tt>) <strong>initialize</strong>(redis)
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
</h3><div class="docstring">
|
206
|
+
<div class="discussion">
|
207
|
+
|
208
|
+
<p>A new instance of Checker</p>
|
209
|
+
|
210
|
+
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
<div class="tags">
|
214
|
+
|
215
|
+
<p class="tag_title">Raises:</p>
|
216
|
+
<ul class="raise">
|
217
|
+
|
218
|
+
<li>
|
219
|
+
|
220
|
+
|
221
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</li>
|
226
|
+
|
227
|
+
</ul>
|
228
|
+
|
229
|
+
</div><table class="source_code">
|
230
|
+
<tr>
|
231
|
+
<td>
|
232
|
+
<pre class="lines">
|
233
|
+
|
234
|
+
|
235
|
+
5
|
236
|
+
6
|
237
|
+
7
|
238
|
+
8</pre>
|
239
|
+
</td>
|
240
|
+
<td>
|
241
|
+
<pre class="code"><span class="info file"># File 'lib/r509/validity/redis/checker.rb', line 5</span>
|
242
|
+
|
243
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_redis'>redis</span><span class='rparen'>)</span>
|
244
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Redis must be provided</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_redis'>redis</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
245
|
+
<span class='ivar'>@redis</span> <span class='op'>=</span> <span class='id identifier rubyid_redis'>redis</span>
|
246
|
+
<span class='kw'>end</span></pre>
|
247
|
+
</td>
|
248
|
+
</tr>
|
249
|
+
</table>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
</div>
|
253
|
+
|
254
|
+
|
255
|
+
<div id="instance_method_details" class="method_details_list">
|
256
|
+
<h2>Instance Method Details</h2>
|
257
|
+
|
258
|
+
|
259
|
+
<div class="method_details first">
|
260
|
+
<h3 class="signature first" id="check-instance_method">
|
261
|
+
|
262
|
+
- (<tt>R509::Validity::Status</tt>) <strong>check</strong>(issuer, serial)
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
</h3><div class="docstring">
|
269
|
+
<div class="discussion">
|
270
|
+
|
271
|
+
|
272
|
+
</div>
|
273
|
+
</div>
|
274
|
+
<div class="tags">
|
275
|
+
|
276
|
+
<p class="tag_title">Returns:</p>
|
277
|
+
<ul class="return">
|
278
|
+
|
279
|
+
<li>
|
280
|
+
|
281
|
+
|
282
|
+
<span class='type'>(<tt>R509::Validity::Status</tt>)</span>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
</li>
|
287
|
+
|
288
|
+
</ul>
|
289
|
+
<p class="tag_title">Raises:</p>
|
290
|
+
<ul class="raise">
|
291
|
+
|
292
|
+
<li>
|
293
|
+
|
294
|
+
|
295
|
+
<span class='type'>(<tt>ArgumentError</tt>)</span>
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
</li>
|
300
|
+
|
301
|
+
</ul>
|
302
|
+
|
303
|
+
</div><table class="source_code">
|
304
|
+
<tr>
|
305
|
+
<td>
|
306
|
+
<pre class="lines">
|
307
|
+
|
308
|
+
|
309
|
+
11
|
310
|
+
12
|
311
|
+
13
|
312
|
+
14
|
313
|
+
15
|
314
|
+
16
|
315
|
+
17
|
316
|
+
18
|
317
|
+
19
|
318
|
+
20
|
319
|
+
21
|
320
|
+
22
|
321
|
+
23
|
322
|
+
24</pre>
|
323
|
+
</td>
|
324
|
+
<td>
|
325
|
+
<pre class="code"><span class="info file"># File 'lib/r509/validity/redis/checker.rb', line 11</span>
|
326
|
+
|
327
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_check'>check</span><span class='lparen'>(</span><span class='id identifier rubyid_issuer'>issuer</span><span class='comma'>,</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
|
328
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Serial and issuer must be provided</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_serial'>serial</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='kw'>or</span> <span class='id identifier rubyid_issuer'>issuer</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
329
|
+
|
330
|
+
<span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='ivar'>@redis</span><span class='period'>.</span><span class='id identifier rubyid_hgetall'>hgetall</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>cert:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_issuer'>issuer</span><span class='rbrace'>}</span><span class='tstring_content'>:</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_serial'>serial</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
331
|
+
<span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>and</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>status</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
332
|
+
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
|
333
|
+
<span class='symbol'>:status</span> <span class='op'>=></span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>status</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='comma'>,</span>
|
334
|
+
<span class='symbol'>:revocation_time</span> <span class='op'>=></span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>revocation_time</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>||</span> <span class='kw'>nil</span><span class='comma'>,</span>
|
335
|
+
<span class='symbol'>:revocation_reason</span> <span class='op'>=></span> <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>revocation_reason</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='op'>||</span> <span class='int'>0</span>
|
336
|
+
<span class='rparen'>)</span>
|
337
|
+
<span class='kw'>else</span>
|
338
|
+
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>Status</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:status</span> <span class='op'>=></span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>UNKNOWN</span><span class='rparen'>)</span>
|
339
|
+
<span class='kw'>end</span>
|
340
|
+
<span class='kw'>end</span></pre>
|
341
|
+
</td>
|
342
|
+
</tr>
|
343
|
+
</table>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
<div class="method_details ">
|
347
|
+
<h3 class="signature " id="is_available?-instance_method">
|
348
|
+
|
349
|
+
- (<tt>Boolean</tt>) <strong>is_available?</strong>
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
</h3><div class="docstring">
|
356
|
+
<div class="discussion">
|
357
|
+
|
358
|
+
|
359
|
+
</div>
|
360
|
+
</div>
|
361
|
+
<div class="tags">
|
362
|
+
|
363
|
+
<p class="tag_title">Returns:</p>
|
364
|
+
<ul class="return">
|
365
|
+
|
366
|
+
<li>
|
367
|
+
|
368
|
+
|
369
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
</li>
|
374
|
+
|
375
|
+
</ul>
|
376
|
+
|
377
|
+
</div><table class="source_code">
|
378
|
+
<tr>
|
379
|
+
<td>
|
380
|
+
<pre class="lines">
|
381
|
+
|
382
|
+
|
383
|
+
26
|
384
|
+
27
|
385
|
+
28</pre>
|
386
|
+
</td>
|
387
|
+
<td>
|
388
|
+
<pre class="code"><span class="info file"># File 'lib/r509/validity/redis/checker.rb', line 26</span>
|
389
|
+
|
390
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_is_available?'>is_available?</span>
|
391
|
+
<span class='lparen'>(</span><span class='ivar'>@redis</span><span class='period'>.</span><span class='id identifier rubyid_ping'>ping</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PONG</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
392
|
+
<span class='kw'>end</span></pre>
|
393
|
+
</td>
|
394
|
+
</tr>
|
395
|
+
</table>
|
396
|
+
</div>
|
397
|
+
|
398
|
+
</div>
|
399
|
+
|
400
|
+
</div>
|
401
|
+
|
402
|
+
<div id="footer">
|
403
|
+
Generated on Mon Oct 15 10:51:03 2012 by
|
404
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
405
|
+
0.8.2.1 (ruby-1.9.3).
|
406
|
+
</div>
|
407
|
+
|
408
|
+
</body>
|
409
|
+
</html>
|