Package org.bouncycastle.util.test

Examples of org.bouncycastle.util.test.TestResult


    }

    public static void main(String[] args)
    {
        Test test = new AttrCertSelectorTest();
        TestResult result = test.perform();
        System.out.println(result);
    }
View Full Code Here


        String[]    args)
    {
        Security.addProvider(new BouncyCastleProvider());

        Test            test = new WrapTest();
        TestResult      result = test.perform();

        System.out.println(result.toString());
        if (result.getException() != null)
        {
            result.getException().printStackTrace();
        }
    }
View Full Code Here

        System.out.println("Testing " + Security.getProvider("BC").getInfo() + " version: " + Security.getProvider("BC").getVersion());
       
        for (int i = 0; i != tests.length; i++)
        {
            TestResult  result = tests[i].perform();
           
            if (result.getException() != null)
            {
                result.getException().printStackTrace();
            }
           
            System.out.println(result);
        }
    }
View Full Code Here

        String[]    args)
    {
        Security.addProvider(new BouncyCastleProvider());

        Test            test = new PSSTest();
        TestResult      result = test.perform();

        System.out.println(result.toString());
    }
View Full Code Here

    }

    public static void main(String[] args)
    {
        Test test = new AttrCertSelectorTest();
        TestResult result = test.perform();
        System.out.println(result);
    }
View Full Code Here

        System.out.println("Testing " + Security.getProvider("BC").getInfo() + " version: " + Security.getProvider("BC").getVersion());
       
        for (int i = 0; i != tests.length; i++)
        {
            TestResult  result = tests[i].perform();
           
            if (result.getException() != null)
            {
                result.getException().printStackTrace();
            }
           
            System.out.println(result);
        }
    }
View Full Code Here

    public static void main(
        String[]    args)
    {
        SHA1HMacTest    test = new SHA1HMacTest();
        TestResult      result = test.perform();

        System.out.println(result);
    }
View Full Code Here

        {
            data = new byte[i];
           
            rand.nextBytes(data);
           
            TestResult result = blockCheck(cipher, padding, key, data);
            if (!result.isSuccessful())
            {
                return result;
            }
        }
View Full Code Here

    {
        SecureRandom    rand = new SecureRandom(new byte[20]);
       
        rand.setSeed(System.currentTimeMillis());
       
        TestResult    res = testPadding(new PKCS7Padding(), rand,
                                    Hex.decode("ffffff0505050505"),
                                    Hex.decode("0000000004040404"));
        if (!res.isSuccessful())
        {
            return res;
        }

        res = testPadding(new ISO10126d2Padding(), rand,
                                    null,
                                    null);
        if (!res.isSuccessful())
        {
            return res;
        }
       
        res = testPadding(new X923Padding(), rand,
                                    null,
                                    null);
        if (!res.isSuccessful())
        {
            return res;
        }

        res = testPadding(new TBCPadding(), rand,
                                    Hex.decode("ffffff0000000000"),
                                    Hex.decode("00000000ffffffff"));
        if (!res.isSuccessful())
        {
            return res;
        }
       
        res = testPadding(new ZeroBytePadding(), rand,
                                    Hex.decode("ffffff0000000000"),
                                    null);
        if (!res.isSuccessful())
        {
            return res;
        }
       
        return new SimpleTestResult(true, getName() + ": Okay");
View Full Code Here

    public static void main(
        String[]    args)
    {
        PaddingTest    test = new PaddingTest();
        TestResult result = test.perform();

        System.out.println(result);
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.util.test.TestResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.