sshkey 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/sshkey.rb +19 -12
- data/lib/sshkey/version.rb +1 -1
- metadata +3 -14
data/README.rdoc
CHANGED
data/lib/sshkey.rb
CHANGED
@@ -8,20 +8,27 @@ class SSHKey
|
|
8
8
|
SSHKey.new(OpenSSL::PKey::RSA.generate(2048).to_pem, options)
|
9
9
|
end
|
10
10
|
|
11
|
-
attr_reader :key_object, :comment
|
11
|
+
attr_reader :key_object, :comment
|
12
12
|
|
13
13
|
def initialize(private_key, options = {})
|
14
|
-
@key_object
|
15
|
-
@comment
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
14
|
+
@key_object = OpenSSL::PKey::RSA.new(private_key)
|
15
|
+
@comment = options[:comment] || ""
|
16
|
+
end
|
17
|
+
|
18
|
+
def rsa_private_key
|
19
|
+
key_object.to_pem
|
20
|
+
end
|
21
|
+
|
22
|
+
def rsa_public_key
|
23
|
+
key_object.public_key.to_pem
|
24
|
+
end
|
25
|
+
|
26
|
+
def ssh_public_key
|
27
|
+
["ssh-rsa", Base64.encode64(ssh_public_key_conversion).gsub("\n", ""), @comment].join(" ").strip
|
28
|
+
end
|
29
|
+
|
30
|
+
def fingerprint
|
31
|
+
Digest::MD5.hexdigest(ssh_public_key_conversion).gsub(/(.{2})(?=.)/, '\1:\2')
|
25
32
|
end
|
26
33
|
|
27
34
|
private
|
data/lib/sshkey/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sshkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 1
|
8
|
-
- 1
|
9
|
-
- 2
|
10
|
-
version: 1.1.2
|
5
|
+
version: 1.1.3
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- James Miller
|
@@ -15,7 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
13
|
+
date: 2011-05-12 00:00:00 -07:00
|
19
14
|
default_executable:
|
20
15
|
dependencies: []
|
21
16
|
|
@@ -52,23 +47,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
47
|
requirements:
|
53
48
|
- - ">="
|
54
49
|
- !ruby/object:Gem::Version
|
55
|
-
hash: 3
|
56
|
-
segments:
|
57
|
-
- 0
|
58
50
|
version: "0"
|
59
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
52
|
none: false
|
61
53
|
requirements:
|
62
54
|
- - ">="
|
63
55
|
- !ruby/object:Gem::Version
|
64
|
-
hash: 3
|
65
|
-
segments:
|
66
|
-
- 0
|
67
56
|
version: "0"
|
68
57
|
requirements: []
|
69
58
|
|
70
59
|
rubyforge_project: sshkey
|
71
|
-
rubygems_version: 1.
|
60
|
+
rubygems_version: 1.6.2
|
72
61
|
signing_key:
|
73
62
|
specification_version: 3
|
74
63
|
summary: SSH private/public key generator in Ruby
|