Beispiel #1
0
        public MFTestResults Pkcs7_Test()
        {
            bool bRes = true;

            try
            {
                Pkcs7 tester = new Pkcs7();

                using (Session sess = new Session("", MechanismType.AES_ECB))
                {
                    bRes &= tester.RunTests(sess, PaddingMode.PKCS7);
                }

                if (m_isEmulator)
                {
                    using (Session sess = new Session("Emulator_Crypto", MechanismType.AES_ECB))
                    {
                        bRes &= tester.RunTests(sess, PaddingMode.PKCS7);
                    }
                }
            }
            catch (NotSupportedException)
            {
                return(MFTestResults.Skip);
            }
            catch (Exception e)
            {
                Log.Exception("", e);
                bRes = false;
            }
            return(bRes ? MFTestResults.Pass : MFTestResults.Fail);
        }
Beispiel #2
0
        public MFTestResults Pkcs7_Test()
        {
            bool bRes = true;

            try
            {
                Pkcs7 tester = new Pkcs7();

                using (Session sess = new Session("", MechanismType.AES_ECB))
                {
                    bRes &= tester.RunTests(sess, PaddingMode.PKCS7);
                }

                if (m_isEmulator)
                {
                    using (Session sess = new Session("Emulator_Crypto", MechanismType.AES_ECB))
                    {
                        bRes &= tester.RunTests(sess, PaddingMode.PKCS7);
                    }
                }
            }
            catch (NotSupportedException)
            {
                return MFTestResults.Skip;
            }
            catch (Exception e)
            {
                Log.Exception("", e);
                bRes = false;
            }
            return bRes ? MFTestResults.Pass : MFTestResults.Fail;
        }