Java 8 CertPathTrustManagerParameters - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 CertPathTrustManagerParameters class.

This code example shows how to use the following methods:getParameters
 */ 
public class CertPathTrustManagerParametersTest extends TestCase {
 
    public void testCertPathTrustManagerParameters() { 
        CertPathParameters parameters = new MyCertPathParameters();
        CertPathTrustManagerParameters p = new CertPathTrustManagerParameters(
                parameters);
        if (!(p.getParameters() instanceof MyCertPathParameters)) {
            fail("incorrect parameters");
        } 
    } 
} 
 
class MyCertPathParameters implements CertPathParameters {
    @Override 
    public Object clone() {
        return new MyCertPathParameters(); 
    } 
} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	 */ 
	@Override 
	protected void engineInit(KeyStore keyStore) throws KeyStoreException {
		try { 
			this
					.engineInit(new CertPathTrustManagerParameters(
							new X509ProxyCertPathParameters(keyStore, null,
									null, false))); 
		} catch (InvalidAlgorithmParameterException e) {
			throw new KeyStoreException(e);
		} 
	} 
 
	/** 
	 * Initializes this factory with a source of provider-specific key material. 
	 * In some cases, initialization parameters other than a keystore may be 
	 * needed by a provider. Users of that particular provider are expected to 
	 * pass an implementation of the appropriate ManagerFactoryParameters as 
	 * defined by the provider. The provider can then call the specified methods 
	 * in the ManagerFactoryParameters implementation to obtain the needed 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getParameters
    public void test_ConstructorLjava_security_cert_CertPathParameters() { 
        // case 1: Try to construct object. 
        try { 
            CertPathParameters parameters = new MyCertPathParameters();
            CertPathTrustManagerParameters p =
                new CertPathTrustManagerParameters(parameters);
            assertNotSame("Parameters were cloned incorrectly",
                    parameters, p.getParameters());
        } catch (Exception e) {
            fail("Unexpected exception " + e.toString());
        } 
 
        // case 2: Check NullPointerException. 
        try { 
            new CertPathTrustManagerParameters(null);
            fail("Expected CertPathTrustManagerParameters was not thrown");
        } catch (NullPointerException npe) {
            // expected 
        } 
    } 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                tmf.init(trustStore);
                tms = tmf.getTrustManagers();
            } else { 
                TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm);
                CertPathParameters params = getParameters(algorithm, crlf, trustStore);
                ManagerFactoryParameters mfp = new CertPathTrustManagerParameters(params);
                tmf.init(mfp);
                tms = tmf.getTrustManagers();
            } 
        } 
         
        return tms;
    } 
     
    /** 
     * Return the initialization parameters for the TrustManager. 
     * Currently, only the default <code>PKIX</code> is supported. 
     *  
     * @param algorithm The algorithm to get parameters for. 
     * @param crlf The path to the CRL file. 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
				tmf.init(trustStore);
				tms = tmf.getTrustManagers();
			} else { 
				TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm);
				CertPathParameters params = getParameters(algorithm, crlf, trustStore);
				ManagerFactoryParameters mfp = new CertPathTrustManagerParameters(params);
				tmf.init(mfp);
				tms = tmf.getTrustManagers();
			} 
		} 
 
		return tms;
	} 
 
	/** 
	 * Gets the SSL server's truststore. 
	 *  
	 * @param keystoreType 
	 * @param keystoreProvider 
	 * @return the SSL server's truststore. 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
                tmf.init(trustStore);
                tms = tmf.getTrustManagers();
            } else { 
                TrustManagerFactory tmf = TrustManagerFactory.getInstance(algorithm);
                CertPathParameters params = getParameters(algorithm, crlf, trustStore);
                ManagerFactoryParameters mfp = new CertPathTrustManagerParameters(params);
                tmf.init(mfp);
                tms = tmf.getTrustManagers();
            } 
        } 
         
        return tms;
    } 
     
    /** 
     * Return the initialization parameters for the TrustManager. 
     * Currently, only the default <code>PKIX</code> is supported. 
     *  
     * @param algorithm The algorithm to get parameters for. 
     * @param crlf The path to the CRL file. 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
See Code Examples for Java 8 CertPathTrustManagerParameters Methods: