xml-kit 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/xml/kit/certificate.rb +4 -3
- data/lib/xml/kit/crypto/oaep_cipher.rb +2 -1
- data/lib/xml/kit/encryption.rb +2 -1
- data/lib/xml/kit/templatable.rb +1 -0
- data/lib/xml/kit/template.rb +1 -0
- data/lib/xml/kit/version.rb +1 -1
- data/xml-kit.gemspec +1 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2eb376d5c11a9777e3a3a6073754c9783c73bdc24bbb45c7ac5877e3e99472
|
4
|
+
data.tar.gz: 6eb275d2a3791889c12a04a5e2b1143807bf4e1ac1968491f93ef32faeccd868
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0447e7510327c68ee2f9f500b980d1d36255b044a3825dfd504245ea111eb367f998a0bc6a507d54e5f64472de76a2766460085c808b8ca380254fdbe12feaa0
|
7
|
+
data.tar.gz: 7f9c69571ddd52a638daf3b20062cc4b2d06cfd7cd83f6a517405330daddc8c8bb8d62fbd054b02ad8ad1eda6a9229ef0221f97d90b4d4ee3318420175eb3405
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/xml-kit.svg)](https://rubygems.org/gems/xml-kit)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/saml-kit/xml-kit.svg)](https://codeclimate.com/github/saml-kit/xml-kit)
|
5
|
-
[![Build Status](https://travis-ci.org/saml-kit/xml-kit.svg)](https://travis-ci.org/saml-kit/xml-kit)
|
5
|
+
[![Build Status](https://travis-ci.org/saml-kit/xml-kit.svg?branch=master)](https://travis-ci.org/saml-kit/xml-kit)
|
6
6
|
[![Security](https://hakiri.io/github/saml-kit/xml-kit/master.svg)](https://hakiri.io/github/saml-kit/xml-kit/master)
|
7
7
|
|
8
8
|
Xml::Kit is a toolkit for working with XML. It supports adding [XML
|
data/lib/xml/kit/certificate.rb
CHANGED
@@ -4,9 +4,9 @@ module Xml
|
|
4
4
|
module Kit
|
5
5
|
# {include:file:spec/xml/certificate_spec.rb}
|
6
6
|
class Certificate
|
7
|
-
BASE64_FORMAT = %r(\A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z)
|
8
|
-
BEGIN_CERT = /-----BEGIN CERTIFICATE
|
9
|
-
END_CERT = /-----END CERTIFICATE
|
7
|
+
BASE64_FORMAT = %r(\A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z).freeze
|
8
|
+
BEGIN_CERT = /-----BEGIN CERTIFICATE-----/.freeze
|
9
|
+
END_CERT = /-----END CERTIFICATE-----/.freeze
|
10
10
|
# The use can be `:signing` or `:encryption`. Use `nil` for both.
|
11
11
|
attr_reader :use
|
12
12
|
|
@@ -29,6 +29,7 @@ module Xml
|
|
29
29
|
# @return [Boolean] true or false.
|
30
30
|
def for?(use)
|
31
31
|
return true if self.use.nil?
|
32
|
+
|
32
33
|
self.use == use.to_sym
|
33
34
|
end
|
34
35
|
|
@@ -4,8 +4,9 @@ module Xml
|
|
4
4
|
module Kit
|
5
5
|
module Crypto
|
6
6
|
class OaepCipher
|
7
|
+
ALGORITHM = "#{::Xml::Kit::Namespaces::XMLENC}rsa-oaep-mgf1p".freeze
|
7
8
|
ALGORITHMS = {
|
8
|
-
|
9
|
+
ALGORITHM => true
|
9
10
|
}.freeze
|
10
11
|
def initialize(_algorithm, key)
|
11
12
|
@key = key
|
data/lib/xml/kit/encryption.rb
CHANGED
@@ -18,7 +18,8 @@ module Xml
|
|
18
18
|
@symmetric_cipher_value = Base64.encode64(symmetric_cipher.encrypt(raw_xml)).delete("\n")
|
19
19
|
|
20
20
|
@asymmetric_algorithm = asymmetric_algorithm
|
21
|
-
|
21
|
+
cipher = Crypto.cipher_for(asymmetric_algorithm, public_key)
|
22
|
+
@asymmetric_cipher_value = Base64.encode64(cipher.encrypt(symmetric_cipher.key)).delete("\n")
|
22
23
|
end
|
23
24
|
|
24
25
|
def to_xml(xml: ::Builder::XmlMarkup.new)
|
data/lib/xml/kit/templatable.rb
CHANGED
data/lib/xml/kit/template.rb
CHANGED
data/lib/xml/kit/version.rb
CHANGED
data/xml-kit.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
lib = File.expand_path('lib', __dir__)
|
@@ -27,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
27
26
|
|
28
27
|
spec.add_dependency 'activemodel', '>= 4.2.0'
|
29
28
|
spec.add_dependency 'builder', '~> 3.2'
|
30
|
-
spec.add_dependency 'nokogiri', '>= 1.8.
|
29
|
+
spec.add_dependency 'nokogiri', '>= 1.8.5'
|
31
30
|
spec.add_dependency 'tilt', '>= 1.4.1'
|
32
31
|
spec.add_dependency 'xmldsig', '~> 0.6'
|
33
32
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
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.14
|
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-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.8.
|
47
|
+
version: 1.8.5
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.8.
|
54
|
+
version: 1.8.5
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: tilt
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|