openssl-additions 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/openssl/yaml_serialization.rb +22 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c4f3a73e293460574c4664cfc46ec88225f98b56af7cb815f1c8884edac28b6
|
4
|
+
data.tar.gz: f12ee14c668926658e218b6f8607e1eb77237df4e0ed6e3fac2f4037051b67b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1af236619dc0e4afb0453327afbddb5b0f814bc0d5ec68e713b2f0b85a638720ec2884002c9e8285d07328c760553f4bcdfffcaebf41f3f166b1c23b99884b06
|
7
|
+
data.tar.gz: 676caa68cf512bd522175302b7ea6576ac87411ee3b69e9935a1b3dde396fd3ddac660648c29f1d355429dc7bb1e095674b47892f7f1b954ceae15d57c379b02
|
data/README.md
CHANGED
@@ -56,6 +56,20 @@ until recently, but once I did, I wrote this.
|
|
56
56
|
key.private? # => false
|
57
57
|
|
58
58
|
|
59
|
+
## Parsing SSH keys
|
60
|
+
|
61
|
+
The `OpenSSL::PKey.from_ssh_key` method can take an OpenSSH public or private
|
62
|
+
key and spit out the appropriate subclass of `OpenSSL::PKey::PKey`.
|
63
|
+
|
64
|
+
|
65
|
+
## YAML Serialization
|
66
|
+
|
67
|
+
If you've ever tried to call `.to_yaml` on an `OpenSSL::X509::Certificate`,
|
68
|
+
you'll have noticed that it doesn't contain anything very useful. Well,
|
69
|
+
if you `require "openssl/yaml_serialization"`, you'll get properly serialized
|
70
|
+
certificates (and keys, and some number of other data types).
|
71
|
+
|
72
|
+
|
59
73
|
# Contributing
|
60
74
|
|
61
75
|
See `CONTRIBUTING.md`.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "openssl"
|
2
|
+
|
3
|
+
class OpenSSL::X509::Certificate
|
4
|
+
def encode_with(coder)
|
5
|
+
coder['der'] = self.to_der
|
6
|
+
end
|
7
|
+
|
8
|
+
def init_with(coder)
|
9
|
+
self.__send__(:initialize, coder['der'])
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class OpenSSL::PKey::PKey
|
14
|
+
def encode_with(coder)
|
15
|
+
coder['der'] = self.to_der
|
16
|
+
end
|
17
|
+
|
18
|
+
def init_with(coder)
|
19
|
+
self.__send__(:initialize, coder['der'])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openssl-additions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -171,6 +171,7 @@ files:
|
|
171
171
|
- lib/openssl/x509/certificate.rb
|
172
172
|
- lib/openssl/x509/request.rb
|
173
173
|
- lib/openssl/x509/spki.rb
|
174
|
+
- lib/openssl/yaml_serialization.rb
|
174
175
|
- openssl-additions.gemspec
|
175
176
|
homepage: https://github.com/pwnedkeys/openssl-additions
|
176
177
|
licenses: []
|