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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da772bcb23095912c4b1c1d888e7a6a748a4f1366774358fff2a5e9b777589c4
4
- data.tar.gz: d5e8f3f2bfc7dea75cb58d7d59d08b60db085f0880f3e00cfc081a90341ed05f
3
+ metadata.gz: 003c8b4f66dd0ccc0cc6c5c108a44949c78a313c82dfa39ad459b7a0286b0a57
4
+ data.tar.gz: f486288e1392e251083f3041a6d2b5577654492462c42695898ec15202aed374
5
5
  SHA512:
6
- metadata.gz: eb0d1e6700863015da3c213102130802d39beeb7af64a02e7b0a2e73df02ff7a7a1ce4b868780605a002cae501b3bd0f98d9c4bb94631802c33834942d0f5a0e
7
- data.tar.gz: f3f1767f93b4bd45d9dcbd14d29899e4411fc3c1a84498f44f06a264e55ac2f09dac1b2790c4f21199e057d3e91a5057a439999b83cbd7288ccc023420ff46c1
6
+ metadata.gz: 564ea8ee284bd6a5b538d07e4387ce95f15aa3f397a41f84225d838631e41b05573df7ac011f50ffc0a94d24d234c68664dc9b04473519224e3262beab33800b
7
+ data.tar.gz: a0d914c9ecf8a7ac17be20de5db50142f2e17077138aada6bc4fab2c03c8cf1c876734f6a6873ef3260e112757e46b1251800e25136b2f74730bf226ecaac502
@@ -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 => error
87
- ::Xml::Kit.logger.warn(error)
87
+ rescue OpenSSL::X509::CertificateError
88
88
  OpenSSL::X509::Certificate.new(value)
89
89
  end
90
90
 
@@ -1,5 +1,5 @@
1
1
  module Xml
2
2
  module Kit
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
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.3
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-01-10 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel