Exemplo n.º 1
0
        public void GetDownloadFileApplicationRequestGeneratesValidXml()
        {
            string            customerUserId    = "customerId";
            X509Certificate2  certificate       = GetX509Certificate2();
            DanskeBankHandler danskeBankHandler = new DanskeBankHandler(customerUserId, certificate);

            XDocument documentXml = danskeBankHandler.GetDownloadFileApplicationRequestXml("fileReference_test", "test System");

            string xmlString = documentXml.ToString();

            Console.Out.WriteLine(xmlString);
        }
Exemplo n.º 2
0
        public void DownloadFileApplicationRequestCanEncryptData()
        {
            string            customerUserId    = "customerId";
            X509Certificate2  certificate       = GetX509Certificate2();
            DanskeBankHandler danskeBankHandler = new DanskeBankHandler(customerUserId, certificate);

            XDocument documentXml = danskeBankHandler.GetDownloadFileApplicationRequestXml("fileReference_test", "test System");

            XDocument encryptedXml = danskeBankHandler.EncryptApplicationRequest(certificate, documentXml);

            XDocument decryptedXml = danskeBankHandler.DecryptApplicationRequest(certificate, encryptedXml);

            //Console.Out.WriteLine(encryptedXml);
            //Console.Out.WriteLine(decryptedXml);

            Assert.AreEqual(documentXml.ToString(), decryptedXml.ToString());
        }