Exemple #1
0
        public void TestCrypto()
        {
            foreach (Org.BouncyCastle.Utilities.Test.ITest test in RegressionTest.tests)
            {
                SimpleTestResult result = (SimpleTestResult)test.Perform();

                if (!result.IsSuccessful())
                {
                    Assert.Fail(result.ToString());
                }
            }
        }
Exemple #2
0
        public override void PerformTest()
        {
            SimpleTestResult str = EncodeDecodePublicLW("Tc26-Gost-3410-12-512-paramSetA", RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512);

            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }

            str = EncodeDecodePrivateLW("Tc26-Gost-3410-12-512-paramSetA", RosstandartObjectIdentifiers.id_tc26_gost_3411_12_512);
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }


            str = EncodeDecodePublicLW("Tc26-Gost-3410-12-256-paramSetA", RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256);
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }

            str = EncodeDecodePrivateLW("Tc26-Gost-3410-12-256-paramSetA", RosstandartObjectIdentifiers.id_tc26_gost_3411_12_256);
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }


            str = DecodeJCEPrivate();
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }

            str = DecodeJCEPublic();
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }

            str = EncodeRecodePrivateKey();
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }

            str = EncodeRecodePublicKey();
            if (!str.IsSuccessful())
            {
                Fail(str.ToString(), str.GetException());
            }
        }
Exemple #3
0
        public void TestOpenSsl()
        {
            Org.BouncyCastle.Utilities.Test.ITest[] tests = new Org.BouncyCastle.Utilities.Test.ITest[] {
                new ReaderTest(),
                new WriterTest()
            };

            foreach (Org.BouncyCastle.Utilities.Test.ITest test in tests)
            {
                SimpleTestResult result = (SimpleTestResult)test.Perform();

                if (!result.IsSuccessful())
                {
                    Assert.Fail(result.ToString());
                }
            }
        }
 private static void Fail(ITest test, string message, string expected, string result)
 {
     throw new TestFailedException(SimpleTestResult.Failed(test, message, expected, result));
 }
 private static void Fail(ITest test, string message)
 {
     throw new TestFailedException(SimpleTestResult.Failed(test, message));
 }