Class: Saml::Kit::XmlDecryption
- Inherits:
-
Object
- Object
- Saml::Kit::XmlDecryption
- Defined in:
- lib/saml/kit/xml_decryption.rb
Instance Attribute Summary collapse
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
Instance Method Summary collapse
- #decrypt(data) ⇒ Object
-
#initialize(private_key = Saml::Kit.configuration.encryption_private_key) ⇒ XmlDecryption
constructor
A new instance of XmlDecryption.
Constructor Details
#initialize(private_key = Saml::Kit.configuration.encryption_private_key) ⇒ XmlDecryption
Returns a new instance of XmlDecryption.
6 7 8 |
# File 'lib/saml/kit/xml_decryption.rb', line 6 def initialize(private_key = Saml::Kit.configuration.encryption_private_key) @private_key = private_key end |
Instance Attribute Details
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
4 5 6 |
# File 'lib/saml/kit/xml_decryption.rb', line 4 def private_key @private_key end |
Instance Method Details
#decrypt(data) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/saml/kit/xml_decryption.rb', line 10 def decrypt(data) encrypt_data = data['EncryptedData'] symmetric_key = symmetric_key_from(encrypt_data) cipher_text = Base64.decode64(encrypt_data["CipherData"]["CipherValue"]) to_plaintext(cipher_text, symmetric_key, encrypt_data["EncryptionMethod"]['Algorithm']) end |