Esempio n. 1
0
        public static SealCard TestNemId2SealAssertion(string keystorePath,
                                                       string userCpr,
                                                       string userGivenName,
                                                       string userSurName,
                                                       string userEmail,
                                                       string userRole,
                                                       string userAuthorizationCode)
        {
            //Opretter et NemID som Saml2Assertion
            //Veksler til Sosi kort
            //Kalder lokal service med Sosikort

            var nemidAssertion = NemIdAssertionBuilder.MakeNemIdAssertion(
                new X509Certificate2(TestContext.CurrentContext.TestDirectory + "/Resources/certificates/" + keystorePath, "Test1234"),
                Global.StatensSerumInstitutFoces,
                userCpr,
                userGivenName,
                userSurName,
                userEmail,
                userRole, "3", "46837428", "Statens Serum Institut",
                userAuthorizationCode);

            var sc = ExchangeNemLoginAssertionForSosiSTSCard(userAuthorizationCode, nemidAssertion);

            var client = new MedicineCardPortTypeClient("FMKTestEnv");

            var getMedicineCardRequest20150601 = FMKRequestMother.GetMedicineCardRequest20150601(userCpr, sc);
            var presStatus = new PrescriptionReplicationStatusType();
            var response   = new MedicineCardType[1];
            var res        = client.GetMedicineCard_2015_06_01(getMedicineCardRequest20150601.Security, getMedicineCardRequest20150601.Header, getMedicineCardRequest20150601.OnBehalfOf, getMedicineCardRequest20150601.WhitelistingHeader, getMedicineCardRequest20150601.ConsentHeader, getMedicineCardRequest20150601.GetMedicineCardRequest, out presStatus, out response);

            return(sc);
        }
Esempio n. 2
0
        public void TestIDcard_Does_not_change_whiteSpace_Saml2SosiStsClient()
        {
            var nemidAssertion = NemIdAssertionBuilder.MakeNemIdAssertion(
                _userCertificate,
                Global.StatensSerumInstitutFoces,
                "0309691444",
                "Sonja",
                "Bach",
                "*****@*****.**",
                "7170",
                "3",
                "46837428",
                "Statens Serum Institut",
                "NS363");

            var sealCard = ExchangeNemLoginAssertionForSosiSTSCard("NS363", nemidAssertion, _userCertificate);

            CallNts(sealCard);

            Assert.IsTrue(SealUtilities.CheckAssertionSignature(sealCard.Xassertion));
        }