Example #1
0
        public EHIntegrationTest()
        {
            ECDSAConfig.Init(); //needed to enable ECDSA globally.

            wstEp = new EndpointAddress("https://services-int.ehealth.fgov.be/IAM/SecurityTokenService/v1");
            //wstEp = new EndpointAddress("https://services-acpt.ehealth.fgov.be/IAM/SecurityTokenService/v1");

            samlpEp = new EndpointAddress("https://services-int.ehealth.fgov.be/IAM/Saml11TokenService/v1");
            //samlpEp = new EndpointAddress("https://services-acpt.ehealth.fgov.be/IAM/Saml11TokenService/v1");

            var p12 = new EHealthP12("files/ehealth-01050399864-int.p12", File.ReadAllText("files/ehealth-01050399864-int.p12.pwd"));

            //var p12 = new EHealthP12("files/ehealth-79021802145-acc.p12", File.ReadAllText("files/ehealth-79021802145-acc.p12.pwd"));
            session = p12["authentication"];

            issuer = new X509Certificate2("files/IAMINT.cer");
            //issuer = new X509Certificate2("files/IAMACC.cer");

            binding = new StsBinding()
            {
                BypassProxyOnLocal = false,
                UseDefaultWebProxy = false,
                ProxyAddress       = new Uri("http://localhost:8080")
            };
        }
Example #2
0
        static XadesVerifier()
        {
            ECDSAConfig.Init();
            CryptoConfig.AddAlgorithm(typeof(OptionalDeflateTransform), OptionalDeflateTransform.AlgorithmUri);
#if NETSTANDARD
            CryptoConfig.AddAlgorithm(typeof(XmlDsigC14NTransform), "http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
            CryptoConfig.AddAlgorithm(typeof(XmlDsigExcC14NTransform), "http://www.w3.org/2001/10/xml-exc-c14n#");
#endif
        }
Example #3
0
 public MockServiceTest()
 {
     ECDSAConfig.Init(); //needed to enable ECDSA globally.
     using (var localhost = new X509Certificate2("files/localhost.cer"))
         using (var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser))
         {
             store.Open(OpenFlags.OpenExistingOnly | OpenFlags.ReadWrite);
             X509Certificate2Collection found = store.Certificates.Find(X509FindType.FindByThumbprint, localhost.Thumbprint, false);
             if (found.Count == 0)
             {
                 throw new InvalidOperationException("localhost cert not trusted");
                 //store.Add(localhost);
             }
         }
 }
Example #4
0
 static XadesCreator()
 {
     ECDSAConfig.Init();
 }
Example #5
0
 public ECDSATest()
 {
     ECDSAConfig.Init();
     clearMsg = System.Text.Encoding.UTF8.GetBytes("Hello world");
 }