Exemple #1
0
 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));
 }
Exemple #2
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"));
 }