Package javax.net.ssl

Examples of javax.net.ssl.KeyManagerFactorySpi


    public void testKeyManagerFactory10() throws NoSuchAlgorithmException {
        if (!DEFSupported) {
            fail(NotSupportedMsg);
            return;
        }
        KeyManagerFactorySpi spi = new MyKeyManagerFactorySpi();
        KeyManagerFactory keyMF = new myKeyManagerFactory(spi, defaultProvider,
                defaultAlgorithm);
        assertTrue("Not CertStore object", keyMF instanceof KeyManagerFactory);
        assertEquals("Incorrect algorithm", keyMF.getAlgorithm(),
                defaultAlgorithm);
View Full Code Here


    public void testKeyManagerFactory10() throws Exception {
        if (!DEFSupported) {
            fail(NotSupportedMsg);
            return;
        }
        KeyManagerFactorySpi spi = new MyKeyManagerFactorySpi();
        KeyManagerFactory keyMF = new myKeyManagerFactory(spi, defaultProvider,
                defaultAlgorithm);
        assertTrue("Not CertStore object", keyMF instanceof KeyManagerFactory);
        assertEquals("Incorrect algorithm", keyMF.getAlgorithm(),
                defaultAlgorithm);
View Full Code Here

     * Test for <code>KeyManagerFactorySpi</code> constructor
     * Assertion: constructs KeyManagerFactorySpi
     */
    public void testKeyManagerFactorySpi01()
            throws Exception {
        KeyManagerFactorySpi kmfSpi = new MyKeyManagerFactorySpi();
        assertNull(kmfSpi.engineGetKeyManagers());
        KeyStore kStore = null;
        ManagerFactoryParameters mfp = null;
       
        char[] pass = { 'a', 'b', 'c' };

        try {
            kmfSpi.engineInit(kStore, null);
            fail("KeyStoreException must be thrown");
        } catch (KeyStoreException e) {
        }
        try {
            kmfSpi.engineInit(kStore, pass);
            fail("UnrecoverableKeyException must be thrown");
        } catch (UnrecoverableKeyException e) {
        }
        try {
            kmfSpi.engineInit(mfp);
            fail("InvalidAlgorithmParameterException must be thrown");
        } catch (InvalidAlgorithmParameterException e) {
        }
        assertNull("getKeyManagers() should return null object",
                kmfSpi.engineGetKeyManagers());
       
        try {
            kStore = KeyStore.getInstance(KeyStore.getDefaultType());
            kStore.load(null, null);           
        } catch (KeyStoreException e) {
            fail("default keystore type is not supported");
            return;
        }
        kmfSpi.engineInit(kStore, pass);

        mfp = new MyKeyManagerFactorySpi.Parameters(kStore, null);
        try {
            kmfSpi.engineInit(mfp);
            fail("InvalidAlgorithmParameterException must be thrown");
        } catch (InvalidAlgorithmParameterException e) {
        }
        mfp = new MyKeyManagerFactorySpi.Parameters(kStore, pass);
        kmfSpi.engineInit(mfp);
    }
View Full Code Here

    public void testKeyManagerFactory10() throws Exception {
        if (!DEFSupported) {
            fail(NotSupportedMsg);
            return;
        }
        KeyManagerFactorySpi spi = new MyKeyManagerFactorySpi();
        KeyManagerFactory keyMF = new myKeyManagerFactory(spi, defaultProvider,
                defaultAlgorithm);
        assertTrue("Not CertStore object", keyMF instanceof KeyManagerFactory);
        assertEquals("Incorrect algorithm", keyMF.getAlgorithm(),
                defaultAlgorithm);
View Full Code Here

TOP

Related Classes of javax.net.ssl.KeyManagerFactorySpi

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.