public void IntegrityIdentityFileWrongCertificate()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     byte[] idFile = dataTest.GetIdFile();
     byte[] idSignatureFile = dataTest.GetIdSignatureFile();
     byte[] certificateRoot = dataTest.GetCertificateRootFile();
     Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRoot));
 }
        public void IntegrityIdentityFileWrongCertificate()
        {
            ReadData  dataTest      = new ReadData("beidpkcs11.dll");
            Integrity integrityTest = new Integrity();

            byte[] idFile          = dataTest.GetIdFile();
            byte[] idSignatureFile = dataTest.GetIdSignatureFile();
            byte[] certificateRoot = dataTest.GetCertificateRootFile();
            Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRoot));
        }
 public void GetCertificateRootFile()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     byte[] certificateFile = dataTest.GetCertificateRootFile();
     X509Certificate certificateRoot;
     Assert.DoesNotThrow(delegate { certificateRoot = new X509Certificate(certificateFile); });
     certificateRoot = new X509Certificate(certificateFile);
     Assert.AreEqual(certificateRoot.Subject, certificateRoot.Issuer, "Should be a self-signed root certificate");
     Assert.True(certificateRoot.Subject.Contains("Root"));
 }
Beispiel #4
0
        public void GetCertificateRootFile()
        {
            ReadData dataTest = new ReadData("beidpkcs11.dll");

            byte[]          certificateFile = dataTest.GetCertificateRootFile();
            X509Certificate certificateRoot;

            Assert.DoesNotThrow(delegate { certificateRoot = new X509Certificate(certificateFile); });
            certificateRoot = new X509Certificate(certificateFile);
            Assert.AreEqual(certificateRoot.Subject, certificateRoot.Issuer, "Should be a self-signed root certificate");
            Assert.True(certificateRoot.Subject.Contains("Root"));
        }
Beispiel #5
0
        public void GetCertificateRootFile()
        {
            ReadData dataTest = new ReadData("beidpkcs11.dll");

            byte[]          certificateFile = dataTest.GetCertificateRootFile();
            X509Certificate certificateRoot;

            try
            {
                certificateRoot = new X509Certificate(certificateFile);
                Assert.IsTrue(certificateRoot.Subject.Contains("Root"));
                Assert.AreEqual(certificateRoot.Subject, certificateRoot.Issuer, "Should be a self-signed root certificate");
            }
            catch
            {
                Assert.Fail();
            }
        }