ruby_easy_rsa 0.2.0.pre.8 → 0.2.0.pre.9
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ruby_easy_rsa.rb +75 -0
- data/lib/ruby_easy_rsa/commands.rb +7 -0
- data/lib/ruby_easy_rsa/commands/base.rb +2 -1
- data/lib/ruby_easy_rsa/commands/export_p12.rb +27 -0
- data/lib/ruby_easy_rsa/commands/export_p7.rb +25 -0
- data/lib/ruby_easy_rsa/commands/import_req.rb +25 -0
- data/lib/ruby_easy_rsa/commands/set_ec_pass.rb +27 -0
- data/lib/ruby_easy_rsa/commands/set_rsa_pass.rb +27 -0
- data/lib/ruby_easy_rsa/commands/show_cert.rb +25 -0
- data/lib/ruby_easy_rsa/commands/show_req.rb +25 -0
- data/lib/ruby_easy_rsa/version.rb +1 -1
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19c789ce2d0b52ae28db8f8a7c8dc787d1de4cfd6de5182b92601a7ca1fbf0de
|
4
|
+
data.tar.gz: 36e252f83def122f1c8476a39832527292a5834542312bed173aeb5fb5833973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d26b161d90fa635cbf1f793514ddcf7a624f30813f1f7bd05e811a07cfb3d0e9ba0cfc88dc8bd4b3d831d110df325ba9b1834a5d1153c48f130085263f5549
|
7
|
+
data.tar.gz: 4b7ad4d64fa3e27546ea5315aab8c151c95ec40e5143c7c11caebd95465e810f73edc355ddc8ee8ac295cf9886a4189eda385f20a88b76a8d07e121c787f48ff
|
data/Gemfile.lock
CHANGED
data/lib/ruby_easy_rsa.rb
CHANGED
@@ -18,6 +18,81 @@ module RubyEasyRSA
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
module ClassMethods
|
22
|
+
def init_pki(opts = {})
|
23
|
+
Commands::InitPKI.new.execute(opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
def build_ca(opts = {})
|
27
|
+
Commands::BuildCA.new.execute(opts)
|
28
|
+
end
|
29
|
+
|
30
|
+
def gen_dh(opts = {})
|
31
|
+
Commands::GenDH.new.execute(opts)
|
32
|
+
end
|
33
|
+
|
34
|
+
def gen_req(opts = {})
|
35
|
+
Commands::GenReq.new.execute(opts)
|
36
|
+
end
|
37
|
+
|
38
|
+
def sign_req(opts = {})
|
39
|
+
Commands::SignReq.new.execute(opts)
|
40
|
+
end
|
41
|
+
|
42
|
+
def build_client_full(opts = {})
|
43
|
+
Commands::BuildClientFull.new.execute(opts)
|
44
|
+
end
|
45
|
+
|
46
|
+
def build_server_full(opts = {})
|
47
|
+
Commands::BuildServerFull.new.execute(opts)
|
48
|
+
end
|
49
|
+
|
50
|
+
def revoke(opts = {})
|
51
|
+
Commands::Revoke.new.execute(opts)
|
52
|
+
end
|
53
|
+
|
54
|
+
def gen_crl(opts = {})
|
55
|
+
Commands::GenCRL.new.execute(opts)
|
56
|
+
end
|
57
|
+
|
58
|
+
def update_db(opts = {})
|
59
|
+
Commands::UpdateDB.new.execute(opts)
|
60
|
+
end
|
61
|
+
|
62
|
+
def show_req(opts = {})
|
63
|
+
Commands::ShowReq.new.execute(opts)
|
64
|
+
end
|
65
|
+
|
66
|
+
def show_cert(opts = {})
|
67
|
+
Commands::ShowCert.new.execute(opts)
|
68
|
+
end
|
69
|
+
|
70
|
+
def import_req(opts = {})
|
71
|
+
Commands::ImportReq.new.execute(opts)
|
72
|
+
end
|
73
|
+
|
74
|
+
def export_p7(opts = {})
|
75
|
+
Commands::ExportP7.new.execute(opts)
|
76
|
+
end
|
77
|
+
|
78
|
+
def export_p12(opts = {})
|
79
|
+
Commands::ExportP12.new.execute(opts)
|
80
|
+
end
|
81
|
+
|
82
|
+
def set_rsa_pass(opts = {})
|
83
|
+
Commands::SetRSAPass.new.execute(opts)
|
84
|
+
end
|
85
|
+
|
86
|
+
def set_ec_pass(opts = {})
|
87
|
+
Commands::SetECPass.new.execute(opts)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
extend ClassMethods
|
91
|
+
|
92
|
+
def self.included(other)
|
93
|
+
other.extend(ClassMethods)
|
94
|
+
end
|
95
|
+
|
21
96
|
class Configuration
|
22
97
|
attr_accessor :binary
|
23
98
|
|
@@ -8,6 +8,13 @@ require_relative 'commands/build_server_full'
|
|
8
8
|
require_relative 'commands/revoke'
|
9
9
|
require_relative 'commands/gen_crl'
|
10
10
|
require_relative 'commands/update_db'
|
11
|
+
require_relative 'commands/show_req'
|
12
|
+
require_relative 'commands/show_cert'
|
13
|
+
require_relative 'commands/import_req'
|
14
|
+
require_relative 'commands/export_p7'
|
15
|
+
require_relative 'commands/export_p12'
|
16
|
+
require_relative 'commands/set_rsa_pass'
|
17
|
+
require_relative 'commands/set_ec_pass'
|
11
18
|
|
12
19
|
module RubyEasyRSA
|
13
20
|
module Commands
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class ExportP12 < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
filename_base = opts[:filename_base]
|
15
|
+
include_ca = opts[:include_ca].nil? ? true : opts[:include_ca]
|
16
|
+
include_key = opts[:include_key].nil? ? true : opts[:include_key]
|
17
|
+
|
18
|
+
builder = super(builder, opts)
|
19
|
+
builder = builder.with_subcommand('export-p12')
|
20
|
+
builder = builder.with_argument(filename_base)
|
21
|
+
builder = builder.with_argument('noca') unless include_ca
|
22
|
+
builder = builder.with_argument('nokey') unless include_key
|
23
|
+
builder
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class ExportP7 < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
filename_base = opts[:filename_base]
|
15
|
+
include_ca = opts[:include_ca].nil? ? true : opts[:include_ca]
|
16
|
+
|
17
|
+
builder = super(builder, opts)
|
18
|
+
builder = builder.with_subcommand('export-p7')
|
19
|
+
builder = builder.with_argument(filename_base)
|
20
|
+
builder = builder.with_argument('noca') unless include_ca
|
21
|
+
builder
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class ImportReq < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
request_file = opts[:request_file]
|
15
|
+
filename_base = opts[:filename_base]
|
16
|
+
|
17
|
+
builder = super(builder, opts)
|
18
|
+
builder = builder.with_subcommand('import-req')
|
19
|
+
builder = builder.with_argument(request_file)
|
20
|
+
builder = builder.with_argument(filename_base)
|
21
|
+
builder
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
require_relative 'mixins/encrypt_key_config'
|
7
|
+
|
8
|
+
module RubyEasyRSA
|
9
|
+
module Commands
|
10
|
+
class SetECPass < Base
|
11
|
+
include Mixins::GlobalConfig
|
12
|
+
include Mixins::SSLConfig
|
13
|
+
include Mixins::EncryptKeyConfig
|
14
|
+
|
15
|
+
def configure_command(builder, opts)
|
16
|
+
filename_base = opts[:filename_base]
|
17
|
+
file = opts[:file]
|
18
|
+
|
19
|
+
builder = builder.with_subcommand('set-ec-pass')
|
20
|
+
builder = builder.with_argument(filename_base)
|
21
|
+
builder = super(builder, opts)
|
22
|
+
builder = builder.with_argument('file') if file
|
23
|
+
builder
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
require_relative 'mixins/encrypt_key_config'
|
7
|
+
|
8
|
+
module RubyEasyRSA
|
9
|
+
module Commands
|
10
|
+
class SetRSAPass < Base
|
11
|
+
include Mixins::GlobalConfig
|
12
|
+
include Mixins::SSLConfig
|
13
|
+
include Mixins::EncryptKeyConfig
|
14
|
+
|
15
|
+
def configure_command(builder, opts)
|
16
|
+
filename_base = opts[:filename_base]
|
17
|
+
file = opts[:file]
|
18
|
+
|
19
|
+
builder = builder.with_subcommand('set-rsa-pass')
|
20
|
+
builder = builder.with_argument(filename_base)
|
21
|
+
builder = super(builder, opts)
|
22
|
+
builder = builder.with_argument('file') if file
|
23
|
+
builder
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class ShowCert < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
filename_base = opts[:filename_base]
|
15
|
+
full = opts[:full]
|
16
|
+
|
17
|
+
builder = super(builder, opts)
|
18
|
+
builder = builder.with_subcommand('show-cert')
|
19
|
+
builder = builder.with_argument(filename_base)
|
20
|
+
builder = builder.with_argument('full') if full
|
21
|
+
builder
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class ShowReq < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
filename_base = opts[:filename_base]
|
15
|
+
full = opts[:full]
|
16
|
+
|
17
|
+
builder = super(builder, opts)
|
18
|
+
builder = builder.with_subcommand('show-req')
|
19
|
+
builder = builder.with_argument(filename_base)
|
20
|
+
builder = builder.with_argument('full') if full
|
21
|
+
builder
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_easy_rsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.pre.
|
4
|
+
version: 0.2.0.pre.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
@@ -162,9 +162,12 @@ files:
|
|
162
162
|
- lib/ruby_easy_rsa/commands/build_ca.rb
|
163
163
|
- lib/ruby_easy_rsa/commands/build_client_full.rb
|
164
164
|
- lib/ruby_easy_rsa/commands/build_server_full.rb
|
165
|
+
- lib/ruby_easy_rsa/commands/export_p12.rb
|
166
|
+
- lib/ruby_easy_rsa/commands/export_p7.rb
|
165
167
|
- lib/ruby_easy_rsa/commands/gen_crl.rb
|
166
168
|
- lib/ruby_easy_rsa/commands/gen_dh.rb
|
167
169
|
- lib/ruby_easy_rsa/commands/gen_req.rb
|
170
|
+
- lib/ruby_easy_rsa/commands/import_req.rb
|
168
171
|
- lib/ruby_easy_rsa/commands/init_pki.rb
|
169
172
|
- lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb
|
170
173
|
- lib/ruby_easy_rsa/commands/mixins/copy_extensions_config.rb
|
@@ -175,6 +178,10 @@ files:
|
|
175
178
|
- lib/ruby_easy_rsa/commands/mixins/ssl_config.rb
|
176
179
|
- lib/ruby_easy_rsa/commands/mixins/sub_ca_config.rb
|
177
180
|
- lib/ruby_easy_rsa/commands/revoke.rb
|
181
|
+
- lib/ruby_easy_rsa/commands/set_ec_pass.rb
|
182
|
+
- lib/ruby_easy_rsa/commands/set_rsa_pass.rb
|
183
|
+
- lib/ruby_easy_rsa/commands/show_cert.rb
|
184
|
+
- lib/ruby_easy_rsa/commands/show_req.rb
|
178
185
|
- lib/ruby_easy_rsa/commands/sign_req.rb
|
179
186
|
- lib/ruby_easy_rsa/commands/update_db.rb
|
180
187
|
- lib/ruby_easy_rsa/version.rb
|