-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSecurityTests.cs
65 lines (57 loc) · 1.78 KB
/
SecurityTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using VertSoft.Peppol.Security.Util;
using VertSoft.Peppol.Security.Xmldsig;
namespace VertSoft.Peppol.Security
{
public static class SecurityTests
{
static public void RunAll()
{
SecurityTests.Run_DifiCertificateValidatorTest(); //Passed
SecurityTests.Run_DomUtilsTest(); //DomUtils class is not used
SecurityTests.Run_ExtraSignatureMethodTest(); //Does nothing
//SecurityTests.Run_XmldsigTest();
Run_EncryptionTest();
}
static private void Run_DifiCertificateValidatorTest()
{
DifiCertificateValidatorTest TestDifiCertificateValidator = new DifiCertificateValidatorTest();
TestDifiCertificateValidator.SimpleSmpTest();
TestDifiCertificateValidator.SimpleSmpProd();
TestDifiCertificateValidator.SimpleApTest();
TestDifiCertificateValidator.SimpleApProd();
Console.WriteLine("Passed DifiCertificateValidatorTest");
}
static private void Run_DomUtilsTest()
{
DomUtilsTest TestDomUtils = new DomUtilsTest();
TestDomUtils.simpleConstructor();
Console.WriteLine("Passed DomUtilsTest");
}
static private void Run_ExtraSignatureMethodTest()
{
//SignatureMethod is a static class with methods for signature.
Console.WriteLine("Passed ExtraSignatureMethodTest");
}
static private void Run_XmldsigTest()
{
XmldsigTest TestXmldsig = new XmldsigTest();
TestXmldsig.SetUp();
TestXmldsig.SimpleContructors();
TestXmldsig.SimpleSHA1();
TestXmldsig.SimpleSHA256();
TestXmldsig.SignAndValidate();
Console.WriteLine("Passed XmldsigTest");
}
static private void Run_EncryptionTest()
{
EncryptionTest TestEncryption = new EncryptionTest();
TestEncryption.SetUp();
TestEncryption.Encrypt();
TestEncryption.Decrypt();
TestEncryption.Verify();
Console.WriteLine("Passed EncryptionTest");
}
}
}