44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
|
using NUnit.Framework;
|
|||
|
using ServiceShared.Crypto;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
|
|||
|
namespace ServiceInsideTest.Controllers
|
|||
|
{
|
|||
|
public class BaseTestController
|
|||
|
{
|
|||
|
protected string ServiceInsideURL = "https://localhost:444";
|
|||
|
protected string ServiceOutsideURL = "https://localhost";
|
|||
|
|
|||
|
public BaseTestController()
|
|||
|
{
|
|||
|
ServiceInside.Service.ServiceOutside.SetServiceOutsideURL(ServiceOutsideURL);
|
|||
|
}
|
|||
|
|
|||
|
[Test]
|
|||
|
public void TestPGS()
|
|||
|
{
|
|||
|
string plz = "41063";
|
|||
|
string gebdatum = "1995-01-31";
|
|||
|
string auftrnr = "1542154758";
|
|||
|
string pgs = SHA512.Encrypt(plz + gebdatum + auftrnr);
|
|||
|
|
|||
|
Assert.IsTrue(pgs == "667ab4f205b542ab73ffa59da5887d4ccc7b84f5ac9f197e9e99c27b840f316ced94a284ffba76b38caa56b39e671c28dcd7f89d4acd70e469a8c7cda2132352");
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
[Test]
|
|||
|
public void Decoder()
|
|||
|
{
|
|||
|
string encoded = "I7YyeSGUKxwD1roq9AFyQA/so72QxiUclvr9JediK8Ge9oIjWdsWaMaO3m+oBSgYqMTEBuCN5FGH83p0VHV4umQR7rMqyEWMBQSFqilJYBzG31uGbeRjQVvujm63PQ4SB0H8PHvyDnspWrVtE3OVOb+US4tHrYY=";
|
|||
|
|
|||
|
string decoded = AES.Decrypt(encoded);
|
|||
|
|
|||
|
int a = 0;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|