acme-r53-cli 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f4626a36b9bdd8e82711dc0d24966f91e274b7200746d441150baef5013484e
4
- data.tar.gz: ca95dbd02eb0b2edd8d09a38c8d20378e68722f2d75395189cfb8d5c641816b7
3
+ metadata.gz: 81e4a028308136100d68827e536be3ec03d4800f59e6b7b72255a478c2c98ecd
4
+ data.tar.gz: 46a3197bc272020c554d78ab9c2ed2e9f4b66fe1425b96e9f5cc2c993a54193f
5
5
  SHA512:
6
- metadata.gz: 10298bb4e0c975c83f100413f6ddea9cf7b5841720b729acbf0c653f5baf11b092d73d7eaefb3294969fe03725d2ff2fc9d498b1b89615f61eba60e1a88bd1f8
7
- data.tar.gz: 7f0388408f2d02b928a3f1179d43e09394617869a60dec47681eee06819929e57ec12125950b802c2000dc9e679d1e3fbf946b710bf920488d570f99c966885f
6
+ metadata.gz: fbd02ad33a745d20e98df2b25176a363d5c4422042eab284f70d41b345c8ff250324be373305664a09518605a365070c86cc5d31bd114a3aafb1619682984e62
7
+ data.tar.gz: 8bd89a1ba55e03f62d14c86e08398de083a33dceab9197c60b88006bbd5abde06755b11934da600ee7e7b5d49aa33ed40c4901755c420cb48895a08a59786502
@@ -23,24 +23,41 @@ Options:
23
23
  --account <account.pem> Provide existing account key
24
24
  --domain <domain.pem> Provide domain private key
25
25
  --staging Use LE Staging directory
26
+ --ec Use EC private keys
26
27
 
27
28
  DOCOPT
28
29
 
29
- def load_key(passed_in, passed_in_path, default_path)
30
+ def make_key_object(file: nil, ec: false)
31
+ if ec
32
+ if file.nil?
33
+ OpenSSL::PKey::EC.generate("prime256v1")
34
+ else
35
+ OpenSSL::PKey::EC.new(file)
36
+ end
37
+ else
38
+ if file.nil?
39
+ OpenSSL::PKey::RSA.new(4096)
40
+ else
41
+ OpenSSL::PKey::RSA.new(file)
42
+ end
43
+ end
44
+ end
45
+
46
+ def load_key(passed_in, passed_in_path, default_path, ec = false)
30
47
  if passed_in
31
48
  STDERR.puts "Loading #{passed_in_path}"
32
49
  if !File.file?(passed_in_path)
33
50
  STDERR.puts "[Error]: Cannot load #{passed_in_path}"
34
51
  exit 1
35
52
  end
36
- OpenSSL::PKey::RSA.new(File.read(passed_in_path))
53
+ make_key_object(file: File.read(passed_in_path), ec: ec)
37
54
  else
38
55
  if File.file?(default_path)
39
56
  STDERR.puts "Loading #{default_path}"
40
- OpenSSL::PKey::RSA.new(File.read(default_path))
57
+ make_key_object(file: File.read(default_path), ec: ec)
41
58
  else
42
59
  STDERR.puts "Creating key #{default_path}"
43
- key = OpenSSL::PKey::RSA.new(4096)
60
+ key = make_key_object(ec: ec)
44
61
  File.write(default_path, key)
45
62
  key
46
63
  end
@@ -147,7 +164,8 @@ end
147
164
  account_key = load_key(
148
165
  !!options["--account"],
149
166
  options["--account"],
150
- "./account.pem"
167
+ "./account.pem",
168
+ options["--ec"]
151
169
  )
152
170
 
153
171
  directory = if options["--staging"]
@@ -203,7 +221,8 @@ elsif options["sign"]
203
221
  domain_key = load_key(
204
222
  !!options["--domain"],
205
223
  options["--domain"],
206
- "./domain.pem"
224
+ "./domain.pem",
225
+ options["--ec"]
207
226
  )
208
227
 
209
228
  STDERR.puts "Signing cert for: #{identifiers.join(", ")}"
@@ -1,5 +1,5 @@
1
1
  module AcmeCli
2
2
  module Version
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acme-r53-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan Apocaca