Package javax.net.ssl

Examples of javax.net.ssl.SSLKeyException


            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    @Override
    protected Object[] getData() {
        return new Object[] { new SSLKeyException(null),
                new SSLKeyException(msgs[0]), new SSLKeyException(msgs[1]) };
    }
View Full Code Here


    public static String[] msgs = {
            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    protected Object[] getData() {
        return new Object[] { new SSLKeyException(null),
                new SSLKeyException(msgs[0]), new SSLKeyException(msgs[1]) };
    }
View Full Code Here

     * Test for <code>SSLKeyException(String)</code> constructor Assertion:
     * constructs SSLKeyException with detail message msg. Parameter
     * <code>msg</code> is not null.
     */
    public void testSSLKeyException01() {
        SSLKeyException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new SSLKeyException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                    .getMessage(), msgs[i]);
            assertNull("getCause() must return null", tE.getCause());
        }
    }
View Full Code Here

     * Test for <code>SSLKeyException(String)</code> constructor Assertion:
     * constructs SSLKeyException when <code>msg</code> is null
     */
    public void testSSLKeyException02() {
        String msg = null;
        SSLKeyException tE = new SSLKeyException(msg);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    }
View Full Code Here

            "New message",
            "Long message for Exception. Long message for Exception. Long message for Exception." };

    @Override
    protected Object[] getData() {
        return new Object[] { new SSLKeyException(null),
                new SSLKeyException(msgs[0]), new SSLKeyException(msgs[1]) };
    }
View Full Code Here

  private SSLSocketFactory getInnerFactory() throws IOException {
    if (innerFactory == null)
    {
      String algorithm = "TLSv1";
      SSLKeyException xx;
      KeyManager[] km = null;
      TrustManager[] tm = null;

      try {
        SSLContext sslCtx = SSLContext.getInstance(algorithm);
        if (trustManager != null)
        {
          tm = new TrustManager[] { trustManager };
        }
        if (keyManager != null)
        {
          km = new KeyManager[] { keyManager };
        }
        sslCtx.init(km, tm, new java.security.SecureRandom() );
        innerFactory = sslCtx.getSocketFactory();
      }
      catch(GeneralSecurityException x) {
        xx = new SSLKeyException("Failed to create SSLContext for " +
            algorithm);
        xx.initCause(x);
        throw xx;
      }
    }
    return innerFactory;
  }
View Full Code Here

TOP

Related Classes of javax.net.ssl.SSLKeyException

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.