certie 0.0.3 → 0.0.4
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/lib/certie.rb +18 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a3c56f3a3837a12b682a1f2ff1afe8259c32f62ee6e34873f3ca77a2c503849
|
4
|
+
data.tar.gz: e19b2ea7b7a3fa9fe158ea17dbd3972a7fa9cc731b2d88660ce87f69c369646f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5027aa317621f51cf8838b67e62c137f52b9382811ecc3745a05021b92a00e6fae977daae625e5a147987b297ed318da810f9f2f2cd41e959e28725aebbac242
|
7
|
+
data.tar.gz: 4c381be9da66e76aa331ed8e5fb70f33374609d585a508a424223e520ce86fef596357aa1f7a9b0f2c589cb2df1188f0a7b7979593adb10677f8dbff2ba4a278
|
data/lib/certie.rb
CHANGED
@@ -7,12 +7,21 @@ class CertificateWrapper
|
|
7
7
|
def self.load_subject_prefix
|
8
8
|
filename = "#{Dir.home}/.certie_subjprefix"
|
9
9
|
if File.exists?(filename)
|
10
|
-
@@subject_prefix = File.read(filename).chomp
|
10
|
+
@@subject_prefix = File.read(filename).chomp
|
11
11
|
else
|
12
12
|
File.write(filename, @@subject_prefix)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
def self.file_cat(output_file, input_array)
|
17
|
+
File.open output_file, 'w' do |outfile|
|
18
|
+
input_array.each do |iter_infile|
|
19
|
+
outfile.write(File.read(iter_infile))
|
20
|
+
outfile.write "\n"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
16
25
|
def self.get_counter_next
|
17
26
|
serial = 0
|
18
27
|
if File.exists?('serial.txt')
|
@@ -90,9 +99,12 @@ class CertificateWrapper
|
|
90
99
|
end
|
91
100
|
end
|
92
101
|
|
93
|
-
# TODO: Find an alternative to invoking OpenSSL and cat
|
102
|
+
# TODO: Find an alternative to invoking OpenSSL and cat - OpenSSL v2.2.0 seems to have private_to_pem in OpenSSL::PKey
|
94
103
|
`openssl pkcs8 -topk8 -inform pem -in "#{cn}.rsa" -out "#{cn}.key" -nocrypt`
|
95
|
-
|
104
|
+
|
105
|
+
# TODO: Test replacement of the system call cat with file_cat
|
106
|
+
# `cat "#{cn}.cert" "#{cn}.key" > "#{cn}.pem"`
|
107
|
+
file_cat "#{cn}.pem", ["#{cn}.cert", "#{cn}.key"]
|
96
108
|
end
|
97
109
|
|
98
110
|
|
@@ -110,3 +122,6 @@ class CertificateWrapper
|
|
110
122
|
create_certificate cn
|
111
123
|
end
|
112
124
|
end
|
125
|
+
|
126
|
+
# key = OpenSSL::PKey::RSA.new 2048
|
127
|
+
# puts key.private_to_pem
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: certie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katkam Nitin Reddy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: openssl
|