lib/sepa/banks/danske/danske_response.rb
def decrypt_application_response
        key = decrypt_embedded_key

        encypted_data = encrypted_application_response
                        .css('CipherValue', 'xmlns' => XMLENC)[1]
                        .content

        encypted_data = decode encypted_data
        iv            = encypted_data[0, 8]
        encypted_data = encypted_data[8, encypted_data.length]

        decipher = OpenSSL::Cipher.new('DES-EDE3-CBC')
        decipher.decrypt
        decipher.key = key
        decipher.iv = iv

        decipher.update(encypted_data) + decipher.final
      end
# Decrypts the application response in the response. Starts by calling {#decrypt_embedded_key}
# method to get the key used in encrypting the application response. After this the encrypted
# data is retrieved from the document and base64 decoded. After this the iv
# (initialization vector) is extracted from the encrypted data and a decipher with the
# 'DES-EDE3-CBC' algorithm is initialized (This is used by banks as encryption algorithm) and
# its key and iv set accordingly and mode changes to decrypt. After this the data is decrypted
# and returned as string.
#
# @return [String] the decrypted application response as raw xml
Decrypts the application response in the response. Starts by calling {#decrypt_embedded_key}
method to get the key used in encrypting the application response. After this the encrypted
data is retrieved from the document and base64 decoded. After this the iv
(initialization vector) is extracted from the encrypted data and a decipher with the
'DES-EDE3-CBC' algorithm is initialized (This is used by banks as encryption algorithm) and
its key and iv set accordingly and mode changes to decrypt. After this the data is decrypted
and returned as string.
Decrypts the application response in the response . Starts by calling { #decrypt_embedded_key } method to get the key used in encrypting the application response . After this the encrypted data is retrieved from the document and base64 decoded . After this the iv ( initialization vector ) is extracted from the encrypted data and a decipher with the ' DES - EDE3 - CBC ' algorithm is initialized ( This is used by banks as encryption algorithm ) and its key and iv set accordingly and mode changes to decrypt . After this the data is decrypted and returned as string .
def decrypt_application_response
        key = decrypt_embedded_key
        encypted_data = encrypted_application_response
                        .css('CipherValue', 'xmlns' => XMLENC)[1]
                        .content
        encypted_data = decode encypted_data
        iv            = encypted_data[0, 8]
        encypted_data = encypted_data[8, encypted_data.length]
        decipher = OpenSSL::Cipher.new('DES-EDE3-CBC')
        decipher.decrypt
        decipher.key = key
        decipher.iv = iv
        decipher.update(encypted_data) + decipher.final
      end
def decrypt_application_response key = decrypt_embedded_key encypted_data = encrypted_application_response . css ( 'CipherValue' , 'xmlns' => XMLENC ) [ 1 ] . content encypted_data = decode encypted_data iv = encypted_data [ 0 , 8 ] encypted_data = encypted_data [ 8 , encypted_data . length ] decipher = OpenSSL :: Cipher . new ( 'DES-EDE3-CBC' ) decipher . decrypt decipher . key = key decipher . iv = iv decipher . update ( encypted_data ) + decipher . final end
Decrypts the application response in the response.
Decrypts the application response in the response .
the decrypted application response as raw xml
the decrypted application response as raw xml
String