Пример #1
0
 public void verification_fails_when_ca_not_in_system_store()
 {
     string invalidManifest = Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
                                           @"res\pki\signed_with_untrusted_cert\sample_module.dll.manifest");
     string invalidManifestSignature = invalidManifest + ".asc";
     var collection = new X509Certificate2Collection();
     var pkiSignatureAlgorithm = new PkiSignatureAlgorithm(collection);
         //none additional certificates
     Assert.IsFalse(pkiSignatureAlgorithm.Verify(File.ReadAllBytes(invalidManifest),
                                                 File.ReadAllBytes(invalidManifestSignature)),
                    "Verification of manifest should not succeed, when CA is not in store");
 }
Пример #2
0
        public void verification_succeeds_when_ca_in_system_store()
        {
            //WARNING: This test requires NomadFakeCa to be installed in system!
            var pkiSignatureAlgorithm = new PkiSignatureAlgorithm(new X509Certificate2Collection());
                //none additional certificates

            Assert.IsTrue(pkiSignatureAlgorithm.Verify(File.ReadAllBytes(_manifestPath),
                                                       File.ReadAllBytes(_manifestSignature)),
                          "Verification of manifest should succeed, when CA in store");
        }