eassl2 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/eassl/certificate_name.rb +17 -18
- data/test/test_eassl.rb +3 -3
- data/test/test_eassl_authority_certificate.rb +2 -2
- data/test/test_eassl_certificate_authority.rb +8 -8
- data/test/test_eassl_signing_request.rb +2 -2
- metadata +32 -12
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
@@ -7,27 +7,26 @@ module EaSSL
|
|
7
7
|
# License:: Distributes under the same terms as Ruby
|
8
8
|
class CertificateName
|
9
9
|
def initialize(options)
|
10
|
-
@options =
|
11
|
-
:country => "US",
|
12
|
-
:state => "North Carolina",
|
13
|
-
:city => "Fuquay Varina",
|
14
|
-
:organization => "WebPower Design",
|
15
|
-
:department => "Web Security",
|
16
|
-
:common_name => nil, # required
|
17
|
-
:email => "eassl@rubyforge.org",
|
18
|
-
}.update(options)
|
10
|
+
@options = options
|
19
11
|
end
|
20
12
|
|
21
13
|
def ssl
|
22
|
-
|
23
|
-
['C',
|
24
|
-
['ST',
|
25
|
-
['L',
|
26
|
-
['O',
|
27
|
-
['OU',
|
28
|
-
['CN',
|
29
|
-
['emailAddress',
|
30
|
-
]
|
14
|
+
name_mapping = [
|
15
|
+
['C', :country],
|
16
|
+
['ST', :state],
|
17
|
+
['L', :city],
|
18
|
+
['O', :organization],
|
19
|
+
['OU', :department],
|
20
|
+
['CN', :common_name],
|
21
|
+
['emailAddress', :email]
|
22
|
+
]
|
23
|
+
|
24
|
+
name = []
|
25
|
+
name_mapping.each do |k|
|
26
|
+
name << [k[0], @options[k[1]], OpenSSL::ASN1::PRINTABLESTRING] if @options[k[1]]
|
27
|
+
end
|
28
|
+
|
29
|
+
OpenSSL::X509::Name.new(name)
|
31
30
|
end
|
32
31
|
|
33
32
|
def name
|
data/test/test_eassl.rb
CHANGED
@@ -8,15 +8,15 @@ class TestEassl < Test::Unit::TestCase
|
|
8
8
|
|
9
9
|
assert ca
|
10
10
|
assert_equal EaSSL::CertificateAuthority, ca.class
|
11
|
-
assert_equal "/
|
11
|
+
assert_equal "/CN=CA", ca.certificate.subject.to_s
|
12
12
|
|
13
13
|
assert sr
|
14
14
|
assert_equal EaSSL::SigningRequest, sr.class
|
15
|
-
assert_equal "/
|
15
|
+
assert_equal "/CN=foo.bar.com", sr.subject.to_s
|
16
16
|
|
17
17
|
assert cert
|
18
18
|
assert_equal EaSSL::Certificate, cert.class
|
19
|
-
assert_equal "/
|
19
|
+
assert_equal "/CN=foo.bar.com", cert.subject.to_s
|
20
20
|
|
21
21
|
key = sr.key
|
22
22
|
assert key
|
@@ -6,8 +6,8 @@ class TestEasslCertificateAuthority < Test::Unit::TestCase
|
|
6
6
|
key = EaSSL::Key.new
|
7
7
|
cacert = EaSSL::AuthorityCertificate.new(:key => key)
|
8
8
|
assert cacert
|
9
|
-
assert_equal "/
|
10
|
-
assert_equal "/
|
9
|
+
assert_equal "/CN=CA", cacert.subject.to_s
|
10
|
+
assert_equal "/CN=CA", cacert.issuer.to_s
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_load_certificate
|
@@ -9,7 +9,7 @@ class TestEasslCertificateAuthority < Test::Unit::TestCase
|
|
9
9
|
assert ca.certificate
|
10
10
|
|
11
11
|
assert_equal 2048, ca.key.length
|
12
|
-
assert_equal "/
|
12
|
+
assert_equal "/CN=CA", ca.certificate.subject.to_s
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_load_ca
|
@@ -59,8 +59,8 @@ class TestEasslCertificateAuthority < Test::Unit::TestCase
|
|
59
59
|
csr = EaSSL::SigningRequest.new(:name => name, :key => key)
|
60
60
|
cert = ca.create_certificate(csr)
|
61
61
|
assert cert
|
62
|
-
assert_equal "/
|
63
|
-
assert_equal "/
|
62
|
+
assert_equal "/CN=foo.bar.com", cert.subject.to_s
|
63
|
+
assert_equal "/CN=CA", cert.issuer.to_s
|
64
64
|
ext_key_usage = cert.extensions.select {|e| e.oid == 'extendedKeyUsage' }
|
65
65
|
assert_equal "TLS Web Server Authentication", ext_key_usage[0].value
|
66
66
|
end
|
@@ -72,8 +72,8 @@ class TestEasslCertificateAuthority < Test::Unit::TestCase
|
|
72
72
|
csr = EaSSL::SigningRequest.new(:name => name, :key => key)
|
73
73
|
cert = ca.create_certificate(csr, 'client')
|
74
74
|
assert cert
|
75
|
-
assert_equal "/
|
76
|
-
assert_equal "/
|
75
|
+
assert_equal "/CN=foo.bar.com", cert.subject.to_s
|
76
|
+
assert_equal "/CN=CA", cert.issuer.to_s
|
77
77
|
ext_key_usage = cert.extensions.select {|e| e.oid == 'extendedKeyUsage' }
|
78
78
|
assert_equal "TLS Web Client Authentication, E-mail Protection", ext_key_usage[0].value
|
79
79
|
end
|
@@ -86,8 +86,8 @@ class TestEasslCertificateAuthority < Test::Unit::TestCase
|
|
86
86
|
t = Time.now
|
87
87
|
cert = ca.create_certificate(csr, 'client', 10)
|
88
88
|
assert cert
|
89
|
-
assert_equal "/
|
90
|
-
assert_equal "/
|
89
|
+
assert_equal "/CN=foo.bar.com", cert.subject.to_s
|
90
|
+
assert_equal "/CN=CA", cert.issuer.to_s
|
91
91
|
ext_key_usage = cert.extensions.select {|e| e.oid == 'extendedKeyUsage' }
|
92
92
|
assert_equal "TLS Web Client Authentication, E-mail Protection", ext_key_usage[0].value
|
93
93
|
assert_equal (t + (24 * 60 * 60 * 10)).to_i, cert.ssl.not_after.to_i
|
@@ -101,7 +101,7 @@ class TestEasslCertificateAuthority < Test::Unit::TestCase
|
|
101
101
|
csr = EaSSL::SigningRequest.new(:name => name, :key => key)
|
102
102
|
cert = ca.create_certificate(csr)
|
103
103
|
assert cert
|
104
|
-
assert_equal "/
|
104
|
+
assert_equal "/CN=foo.bar.com", cert.subject.to_s
|
105
105
|
assert_equal "/C=US/O=Venda/OU=auto-CA/CN=CA", cert.issuer.to_s
|
106
106
|
end
|
107
107
|
|
@@ -6,7 +6,7 @@ class TestEasslSigningRequest < Test::Unit::TestCase
|
|
6
6
|
name = EaSSL::CertificateName.new(:common_name => 'foo.bar.com')
|
7
7
|
csr = EaSSL::SigningRequest.new(:name => name)
|
8
8
|
assert csr
|
9
|
-
assert_equal "/
|
9
|
+
assert_equal "/CN=foo.bar.com", csr.subject.to_s
|
10
10
|
assert csr.key
|
11
11
|
assert_equal 2048, csr.key.length
|
12
12
|
end
|
@@ -17,7 +17,7 @@ class TestEasslSigningRequest < Test::Unit::TestCase
|
|
17
17
|
name = EaSSL::CertificateName.new(:common_name => 'foo.bar.com')
|
18
18
|
csr = EaSSL::SigningRequest.new(:name => name, :key => key)
|
19
19
|
assert csr
|
20
|
-
assert_equal "/
|
20
|
+
assert_equal "/CN=foo.bar.com", csr.subject.to_s
|
21
21
|
end
|
22
22
|
|
23
23
|
def test_load_csr_file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eassl2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2013-02-03 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
18
|
-
requirement:
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ~>
|
@@ -23,10 +23,15 @@ dependencies:
|
|
23
23
|
version: 1.0.0
|
24
24
|
type: :development
|
25
25
|
prerelease: false
|
26
|
-
version_requirements:
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ~>
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: 1.0.0
|
27
32
|
- !ruby/object:Gem::Dependency
|
28
33
|
name: jeweler
|
29
|
-
requirement:
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
30
35
|
none: false
|
31
36
|
requirements:
|
32
37
|
- - ~>
|
@@ -34,10 +39,15 @@ dependencies:
|
|
34
39
|
version: 1.5.2
|
35
40
|
type: :development
|
36
41
|
prerelease: false
|
37
|
-
version_requirements:
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.5.2
|
38
48
|
- !ruby/object:Gem::Dependency
|
39
49
|
name: rcov
|
40
|
-
requirement:
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
41
51
|
none: false
|
42
52
|
requirements:
|
43
53
|
- - ! '>='
|
@@ -45,10 +55,15 @@ dependencies:
|
|
45
55
|
version: '0'
|
46
56
|
type: :development
|
47
57
|
prerelease: false
|
48
|
-
version_requirements:
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
49
64
|
- !ruby/object:Gem::Dependency
|
50
65
|
name: simplecov
|
51
|
-
requirement:
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
52
67
|
none: false
|
53
68
|
requirements:
|
54
69
|
- - ! '>='
|
@@ -56,7 +71,12 @@ dependencies:
|
|
56
71
|
version: '0'
|
57
72
|
type: :development
|
58
73
|
prerelease: false
|
59
|
-
version_requirements:
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
60
80
|
description: This gem is a more featureful but still drop-in replacement for eassl
|
61
81
|
0.1.1643
|
62
82
|
email: chris@nodnol.org
|
@@ -115,7 +135,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
135
|
version: '0'
|
116
136
|
segments:
|
117
137
|
- 0
|
118
|
-
hash:
|
138
|
+
hash: 3639060836487428709
|
119
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
140
|
none: false
|
121
141
|
requirements:
|
@@ -124,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
144
|
version: '0'
|
125
145
|
requirements: []
|
126
146
|
rubyforge_project:
|
127
|
-
rubygems_version: 1.8.
|
147
|
+
rubygems_version: 1.8.24
|
128
148
|
signing_key:
|
129
149
|
specification_version: 3
|
130
150
|
summary: EaSSL is a library aimed at making openSSL certificate generation and management
|