Package org.apache.harmony.security.tests.support

Examples of org.apache.harmony.security.tests.support.MyAlgorithmParameterGeneratorSpi


    public void testAlgorithmParameterGeneratorConstr() throws NoSuchAlgorithmException {
        if (!DSASupported) {
            fail(validAlgName + " algorithm is not supported");
            return;
        }
        AlgorithmParameterGeneratorSpi spi = new MyAlgorithmParameterGeneratorSpi();
        AlgorithmParameterGenerator apg =
                new myAlgPG(spi, validProvider, validAlgName);
        assertEquals("Incorrect algorithm", apg.getAlgorithm(), validAlgName);
        assertEquals("Incorrect provider",apg.getProvider(),validProvider);
        try {
View Full Code Here


     * Test for <code>AlgorithmParameterGeneratorSpi</code> constructor
     * Assertion: constructs AlgorithmParameterGeneratorSpi
     */
    public void testAlgorithmParameterGeneratorSpi01()
            throws InvalidAlgorithmParameterException {
        AlgorithmParameterGeneratorSpi algParGen = new MyAlgorithmParameterGeneratorSpi();
        AlgorithmParameters param = algParGen.engineGenerateParameters();
        assertNull("Not null parameters", param);
        AlgorithmParameterSpec pp = null;
        algParGen.engineInit(pp, new SecureRandom());
        try {
            algParGen.engineInit(pp, null);
            fail("IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
        }
        algParGen.engineInit(0, null);
        algParGen.engineInit(0, new SecureRandom());       
       
        try {
            algParGen.engineInit(-10, null);
            fail("IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
        }
        try {
            algParGen.engineInit(-10, new SecureRandom());
            fail("IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
        }       
    }
View Full Code Here

    public void testAlgorithmParameterGeneratorConstr() throws NoSuchAlgorithmException {
        if (!DSASupported) {
            fail(validAlgName + " algorithm is not supported");
            return;
        }
        AlgorithmParameterGeneratorSpi spi = new MyAlgorithmParameterGeneratorSpi();
        AlgorithmParameterGenerator apg =
                new myAlgPG(spi, validProvider, validAlgName);
        assertEquals("Incorrect algorithm", apg.getAlgorithm(), validAlgName);
        assertEquals("Incorrect provider",apg.getProvider(),validProvider);
        try {
View Full Code Here

     * Test for <code>AlgorithmParameterGeneratorSpi</code> constructor
     * Assertion: constructs AlgorithmParameterGeneratorSpi
     */
    public void testAlgorithmParameterGeneratorSpi01()
            throws InvalidAlgorithmParameterException {
        AlgorithmParameterGeneratorSpi algParGen = new MyAlgorithmParameterGeneratorSpi();
        AlgorithmParameters param = algParGen.engineGenerateParameters();
        assertNull("Not null parameters", param);
        AlgorithmParameterSpec pp = null;
        algParGen.engineInit(pp, new SecureRandom());
        try {
            algParGen.engineInit(pp, null);
            fail("IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
        }
        algParGen.engineInit(0, null);
        algParGen.engineInit(0, new SecureRandom());       
       
        try {
            algParGen.engineInit(-10, null);
            fail("IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
        }
        try {
            algParGen.engineInit(-10, new SecureRandom());
            fail("IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
        }       
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.security.tests.support.MyAlgorithmParameterGeneratorSpi

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.