puttygen 0.1.0 → 0.2.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 +4 -4
- data/lib/puttygen.rb +7 -2
- data/lib/puttygen/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f987485a84419b06590467ca9f6ebba8a06b743
|
4
|
+
data.tar.gz: c0c1bb5e450985ff6acdf9fd138df6d0080fdded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61a6c42125e9b9888bb1e0c4bacdeb36a6c716e7f16207ad2b0f4e42a759e4c19c9dbbb9a237fd007218d599113f9a013f32edc83b4539193c13c1ca9852d5de
|
7
|
+
data.tar.gz: 90e8b5b740b862f60d3fb2980bab065aa761d9d310aba0d1d5bc84efe07991d5050abc9577ea3f0916f23736c9bfee6d02a9e46880576cc6bd4d262dc1df0884
|
data/lib/puttygen.rb
CHANGED
@@ -32,7 +32,7 @@ module Puttygen
|
|
32
32
|
# @param output_format [Symbol] output format of private key to generate, one of +:putty+, +:openssh+ or +:sshcom+
|
33
33
|
# @return [String] private key contents
|
34
34
|
def self.convert_private_key(private_key_path, output_format: :putty)
|
35
|
-
outfile =
|
35
|
+
outfile = build_temp_filename
|
36
36
|
outflag = PRIVATE_OUTPUT_FORMATS.fetch(output_format, 'private')
|
37
37
|
out, status = Open3.capture2e("puttygen #{private_key_path} -q -O #{outflag} -o #{outfile}")
|
38
38
|
process_exit_status(out, status)
|
@@ -62,7 +62,7 @@ module Puttygen
|
|
62
62
|
# @param public_format [Symbol] output format of public key to generate, one of +:standard+, +:openssh+ or +:sshcom+
|
63
63
|
# @return [Keypair] public and private keys
|
64
64
|
def self.generate_keypair(type: :rsa, bits: 2048, comment: nil, passphrase: nil, private_format: :putty, public_format: :standard)
|
65
|
-
outfile =
|
65
|
+
outfile = build_temp_filename
|
66
66
|
outflag = PRIVATE_OUTPUT_FORMATS.fetch(private_format, 'private')
|
67
67
|
line = "puttygen -q -t #{type} -b #{bits} -C '#{comment}' -O #{outflag} -o #{outfile}"
|
68
68
|
|
@@ -102,4 +102,9 @@ module Puttygen
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
def self.build_temp_filename
|
106
|
+
name = Dir::Tmpname.make_tmpname('/', nil)
|
107
|
+
File.join(Dir.tmpdir, name).to_s
|
108
|
+
end
|
109
|
+
|
105
110
|
end
|
data/lib/puttygen/version.rb
CHANGED