Method: Saml::Util.decrypt_encrypted_id

Defined in:
lib/saml/util.rb

.decrypt_encrypted_id(encrypted_id, private_key, fail_silent = false) ⇒ Object



137
138
139
140
141
142
# File 'lib/saml/util.rb', line 137

def decrypt_encrypted_id(encrypted_id, private_key, fail_silent = false)
  encrypted_id_xml   = encrypted_id.is_a?(Saml::Elements::EncryptedID) ?
      encrypted_id.to_xml : encrypted_id.to_s
  encrypted_document = Xmlenc::EncryptedDocument.new(encrypted_id_xml)
  Saml::Elements::EncryptedID.parse(encrypted_document.decrypt(private_key, fail_silent))
end