certificate_authority 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -211,7 +211,7 @@ To configure a certificate to utilize PKCS#11 instead of in memory keys all you
211
211
  root.key_material = key_material_in_hardware
212
212
  root.sign!
213
213
 
214
- You're current version of OpenSSL _must_ include dynamic engine support and you will need to have OpenSSL PKCS#11 engine support. You will also require the actual PKCS#11 driver from the hardware manufacturer. As of today the only tokens I've gotten to work are:
214
+ Your current version of OpenSSL _must_ include dynamic engine support and you will need to have OpenSSL PKCS#11 engine support. You will also require the actual PKCS#11 driver from the hardware manufacturer. As of today the only tokens I've gotten to work are:
215
215
 
216
216
  [eTokenPro] Released by Aladdin (now SafeNet Inc.). I have only had success with the version 4 and 5 (32 bit only) copy of the driver. The newer authentication client released by SafeNet appears to be completely broken for interacting with the tokens outside of SafeNet's own tools. If anyone has a different experience I'd like to hear from you.
217
217
 
@@ -234,4 +234,4 @@ Released under the MIT License: http://www.opensource.org/licenses/mit-license.p
234
234
 
235
235
  Main page: http://github.com/cchandler/certificateauthority
236
236
 
237
- Issue tracking: https://github.com/cchandler/certificateauthority/issues
237
+ Issue tracking: https://github.com/cchandler/certificateauthority/issues
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 2
4
+ :patch: 3
5
5
  :build:
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{certificate_authority}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Chris Chandler"]
12
- s.date = %q{2011-04-21}
12
+ s.date = %q{2011-05-08}
13
13
  s.email = %q{chris@flatterline.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.rdoc"
@@ -21,8 +21,11 @@ module CertificateAuthority
21
21
  errors.add :base, "Key material name must be valid" unless key_material.valid?
22
22
  errors.add :base, "Serial number must be valid" unless serial_number.valid?
23
23
  errors.add :base, "Extensions must be valid" unless extensions.each do |item|
24
- return true unless item.respond_to?(:valid?)
25
- item.valid?
24
+ unless item.respond_to?(:valid?)
25
+ true
26
+ else
27
+ item.valid?
28
+ end
26
29
  end
27
30
  end
28
31
 
@@ -111,6 +111,7 @@ module CertificateAuthority
111
111
  end
112
112
 
113
113
  def to_s
114
+ return "" if self.ocsp.empty?
114
115
  "OCSP;URI:#{self.ocsp}"
115
116
  end
116
117
  end
@@ -194,6 +194,23 @@ describe CertificateAuthority::Certificate do
194
194
  end
195
195
  end
196
196
 
197
+ describe "AuthorityInfoAccess" do
198
+ before(:each) do
199
+ @certificate = CertificateAuthority::Certificate.new
200
+ @certificate.subject.common_name = "chrischandler.name"
201
+ @certificate.key_material.generate_key
202
+ @certificate.serial_number.number = 1
203
+ end
204
+
205
+ it "should have an authority info access if specified" do
206
+ @certificate.sign!({"extensions" => {"authorityInfoAccess" => {"ocsp" => ["www.chrischandler.name"]}}})
207
+ cert = OpenSSL::X509::Certificate.new(@certificate.to_pem)
208
+ cert.extensions.map(&:oid).include?("authorityInfoAccess").should be_true
209
+ end
210
+
211
+ end
212
+
213
+
197
214
  describe "CertificatePolicies" do
198
215
  before(:each) do
199
216
  @certificate = CertificateAuthority::Certificate.new
@@ -260,11 +277,6 @@ describe CertificateAuthority::Certificate do
260
277
  cert.extensions.map(&:oid).include?("authorityKeyIdentifier").should be_true
261
278
  end
262
279
 
263
- it "should support authorityInfoAccess" do
264
- cert = OpenSSL::X509::Certificate.new(@certificate.to_pem)
265
- cert.extensions.map(&:oid).include?("authorityInfoAccess").should be_true
266
- end
267
-
268
280
  it "should support keyUsage" do
269
281
  cert = OpenSSL::X509::Certificate.new(@certificate.to_pem)
270
282
  cert.extensions.map(&:oid).include?("keyUsage").should be_true
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: certificate_authority
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Chris Chandler
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-21 00:00:00 Z
13
+ date: 2011-05-08 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activemodel
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- hash: -4291817206657186993
109
+ hash: -1705898216239460506
110
110
  segments:
111
111
  - 0
112
112
  version: "0"