Ejemplo n.º 1
0
 public void IntegrityIdentityFileWrongSignature()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     byte[] idFile = dataTest.GetIdFile();
     byte[] idSignatureFile = dataTest.GetAddressSignatureFile();
     byte[] certificateRRN = dataTest.GetCertificateRNFile();
     Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRRN));
 }
Ejemplo n.º 2
0
        public void IntegrityIdentityFileWrongSignature()
        {
            ReadData  dataTest      = new ReadData("beidpkcs11.dll");
            Integrity integrityTest = new Integrity();

            byte[] idFile          = dataTest.GetIdFile();
            byte[] idSignatureFile = dataTest.GetAddressSignatureFile();
            byte[] certificateRRN  = dataTest.GetCertificateRNFile();
            Assert.False(integrityTest.Verify(idFile, idSignatureFile, certificateRRN));
        }
Ejemplo n.º 3
0
 public void IntegrityAddressFile()
 {
     ReadData dataTest = new ReadData("beidpkcs11.dll");
     Integrity integrityTest = new Integrity();
     byte[] addressFile = trimRight(dataTest.GetAddressFile());
     byte[] idSignatureFile = dataTest.GetIdSignatureFile();
     byte[] concatFiles = new byte[addressFile.Length + idSignatureFile.Length];
     Array.Copy(addressFile, 0, concatFiles, 0, addressFile.Length);
     Array.Copy(idSignatureFile, 0, concatFiles, addressFile.Length, idSignatureFile.Length);
     byte[] addressSignatureFile = dataTest.GetAddressSignatureFile();
     byte[] certificateRRN = dataTest.GetCertificateRNFile();
     Assert.True(integrityTest.Verify(concatFiles, addressSignatureFile, certificateRRN));
 }
Ejemplo n.º 4
0
        public void IntegrityAddressFile()
        {
            ReadData  dataTest      = new ReadData("beidpkcs11.dll");
            Integrity integrityTest = new Integrity();

            byte[] addressFile     = trimRight(dataTest.GetAddressFile());
            byte[] idSignatureFile = dataTest.GetIdSignatureFile();
            byte[] concatFiles     = new byte[addressFile.Length + idSignatureFile.Length];
            Array.Copy(addressFile, 0, concatFiles, 0, addressFile.Length);
            Array.Copy(idSignatureFile, 0, concatFiles, addressFile.Length, idSignatureFile.Length);
            byte[] addressSignatureFile = dataTest.GetAddressSignatureFile();
            byte[] certificateRRN       = dataTest.GetCertificateRNFile();
            Assert.True(integrityTest.Verify(concatFiles, addressSignatureFile, certificateRRN));
        }