libsaml 2.22.2 → 2.23.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml/elements/encrypted_attribute.rb +23 -0
- data/lib/saml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b0fea88cbabb7ef6da156f348494ec005e3ec78
|
4
|
+
data.tar.gz: 6793447534a1947ea4ce6da59b459315ca48eaf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 350001a2afe90a33823c33d3fc75e67c7375c076e40de376ef12f4d442f0f805c20575e223334cc086695d9f346a715ab5d1a7e3c1688623ff11c2746d7bd43d
|
7
|
+
data.tar.gz: 597ec590265c404e9d844e23347a036d1782a6c8358df0690ce786b3e09789a60a52b6d1f7410305ab2b56f3c2590c814febbb25e84b14a53e857107580e6d7d
|
@@ -13,6 +13,29 @@ module Saml
|
|
13
13
|
has_many :encrypted_keys, Xmlenc::Builder::EncryptedKey, xpath: "./"
|
14
14
|
|
15
15
|
validates :encrypted_data, presence: true
|
16
|
+
|
17
|
+
def encrypt(attribute, encrypted_key_data, encrypted_data_options = {})
|
18
|
+
self.encrypted_data = Xmlenc::Builder::EncryptedData.new(encrypted_data_options)
|
19
|
+
self.encrypted_data.set_encryption_method algorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'
|
20
|
+
self.encrypted_data.set_key_name key_name
|
21
|
+
|
22
|
+
encrypted_key_data.each do |key_descriptor, key_options|
|
23
|
+
encrypted_key = self.encrypted_data.encrypt Nokogiri::XML(attribute.to_xml).root.to_xml, key_options
|
24
|
+
encrypted_key.set_encryption_method algorithm: 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p', digest_method_algorithm: 'http://www.w3.org/2000/09/xmldsig#sha1'
|
25
|
+
encrypted_key.set_key_name key_descriptor.key_info.key_name
|
26
|
+
encrypted_key.carried_key_name = key_name
|
27
|
+
encrypted_key.encrypt key_descriptor.certificate.public_key
|
28
|
+
|
29
|
+
self.encrypted_keys ||= []
|
30
|
+
self.encrypted_keys << encrypted_key
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def key_name
|
37
|
+
@key_name ||= Saml.generate_id
|
38
|
+
end
|
16
39
|
end
|
17
40
|
end
|
18
41
|
end
|
data/lib/saml/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libsaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoist Claassen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|