xml-kit 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xml/kit/certificate.rb +5 -5
- data/lib/xml/kit/version.rb +1 -1
- 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: 003c8b4f66dd0ccc0cc6c5c108a44949c78a313c82dfa39ad459b7a0286b0a57
|
4
|
+
data.tar.gz: f486288e1392e251083f3041a6d2b5577654492462c42695898ec15202aed374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 564ea8ee284bd6a5b538d07e4387ce95f15aa3f397a41f84225d838631e41b05573df7ac011f50ffc0a94d24d234c68664dc9b04473519224e3262beab33800b
|
7
|
+
data.tar.gz: a0d914c9ecf8a7ac17be20de5db50142f2e17077138aada6bc4fab2c03c8cf1c876734f6a6873ef3260e112757e46b1251800e25136b2f74730bf226ecaac502
|
data/lib/xml/kit/certificate.rb
CHANGED
@@ -4,12 +4,12 @@ module Xml
|
|
4
4
|
class Certificate
|
5
5
|
BEGIN_CERT=/-----BEGIN CERTIFICATE-----/
|
6
6
|
END_CERT=/-----END CERTIFICATE-----/
|
7
|
-
# The use can be `:signing` or `:encryption`
|
7
|
+
# The use can be `:signing` or `:encryption`. Use `nil` for both.
|
8
8
|
attr_reader :use
|
9
9
|
|
10
|
-
def initialize(value, use:)
|
10
|
+
def initialize(value, use: nil)
|
11
11
|
@value = value
|
12
|
-
@use = use.downcase.to_sym
|
12
|
+
@use = use.nil? ? use : use.downcase.to_sym
|
13
13
|
end
|
14
14
|
|
15
15
|
# @return [Xml::Kit::Fingerprint] the certificate fingerprint.
|
@@ -22,6 +22,7 @@ module Xml
|
|
22
22
|
# @param use [Symbol] `:signing` or `:encryption`.
|
23
23
|
# @return [Boolean] true or false.
|
24
24
|
def for?(use)
|
25
|
+
return true if self.use.nil?
|
25
26
|
self.use == use.to_sym
|
26
27
|
end
|
27
28
|
|
@@ -83,8 +84,7 @@ module Xml
|
|
83
84
|
|
84
85
|
def self.to_x509(value)
|
85
86
|
OpenSSL::X509::Certificate.new(Base64.decode64(value))
|
86
|
-
rescue OpenSSL::X509::CertificateError
|
87
|
-
::Xml::Kit.logger.warn(error)
|
87
|
+
rescue OpenSSL::X509::CertificateError
|
88
88
|
OpenSSL::X509::Certificate.new(value)
|
89
89
|
end
|
90
90
|
|
data/lib/xml/kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mo khan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|