Package javax.net.ssl

Examples of javax.net.ssl.TrustManagerFactorySpi


    public void testTrustManagerFactory10() throws NoSuchAlgorithmException {
        if (!DEFSupported) {
            fail(NotSupportedMsg);
            return;
        }
        TrustManagerFactorySpi spi = new MyTrustManagerFactorySpi();
        TrustManagerFactory tmF = new myTrustManagerFactory(spi, defaultProvider,
                defaultAlgorithm);
        assertTrue("Not CertStore object", tmF instanceof TrustManagerFactory);
        assertEquals("Incorrect algorithm", tmF.getAlgorithm(),
                defaultAlgorithm);
View Full Code Here


    public void testTrustManagerFactory10() throws NoSuchAlgorithmException {
        if (!DEFSupported) {
            fail(NotSupportedMsg);
            return;
        }
        TrustManagerFactorySpi spi = new MyTrustManagerFactorySpi();
        TrustManagerFactory tmF = new myTrustManagerFactory(spi, defaultProvider,
                defaultAlgorithm);
        assertTrue("Not CertStore object", tmF instanceof TrustManagerFactory);
        assertEquals("Incorrect algorithm", tmF.getAlgorithm(),
                defaultAlgorithm);
View Full Code Here

    public void testTrustManagerFactory10() throws NoSuchAlgorithmException {
        if (!DEFSupported) {
            fail(NotSupportedMsg);
            return;
        }
        TrustManagerFactorySpi spi = new MyTrustManagerFactorySpi();
        TrustManagerFactory tmF = new myTrustManagerFactory(spi, defaultProvider,
                defaultAlgorithm);
        assertTrue("Not CertStore object", tmF instanceof TrustManagerFactory);
        assertEquals("Incorrect algorithm", tmF.getAlgorithm(),
                defaultAlgorithm);
View Full Code Here

    /**
     * Test for <code>TrustManagerFactorySpi</code> constructor
     * Assertion: constructs TrustManagerFactorySpi
     */
    public void testTrustManagerFactorySpi01() throws Exception {
        TrustManagerFactorySpi kmfSpi = new MyTrustManagerFactorySpi();       
        assertNull("Not null results", kmfSpi.engineGetTrustManagers());
        KeyStore kStore = null;
        ManagerFactoryParameters mfp = null;
       
        try {
            kmfSpi.engineInit(kStore);
            fail("KeyStoreException must be thrown");
        } catch (KeyStoreException e) {
        }
        try {
            kmfSpi.engineInit(mfp);
            fail("InvalidAlgorithmParameterException must be thrown");
        } catch (InvalidAlgorithmParameterException e) {
        }
        assertNull("getTrustManagers() should return null object",
                kmfSpi.engineGetTrustManagers());    
       
        try {
            kStore = KeyStore.getInstance(KeyStore.getDefaultType());
            kStore.load(null, null);           
        } catch (KeyStoreException e) {
            fail("default keystore is not supported");
            return;
        }
        kmfSpi.engineInit(kStore);
        mfp = new MyTrustManagerFactorySpi.Parameters(null);
        try {
            kmfSpi.engineInit(mfp);
            fail("RuntimeException must be thrown");
        } catch (RuntimeException e) {
            assertTrue("Incorrect exception", e.getCause() instanceof KeyStoreException);
        }
        mfp = new MyTrustManagerFactorySpi.Parameters(kStore);
        kmfSpi.engineInit(mfp);
    }
View Full Code Here

TOP

Related Classes of javax.net.ssl.TrustManagerFactorySpi

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.