javax.net.ssl.SSLContext.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中javax.net.ssl.SSLContext.<init>()方法的一些代码示例,展示了SSLContext.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SSLContext.<init>()方法的具体详情如下:
包路径:javax.net.ssl.SSLContext
类名称:SSLContext
方法名:<init>

SSLContext.<init>介绍

[英]Creates a new SSLContext.
[中]创建一个新的SSLContext。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: robovm/robovm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol.
 *
 * @param protocol
 *            the requested protocol to create a context for.
 * @return the created {@code SSLContext} instance.
 * @throws NoSuchAlgorithmException
 *             if no installed provider can provide the requested protocol
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol) throws NoSuchAlgorithmException {
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Engine.SpiAndProvider sap = ENGINE.getInstance(protocol, null);
  return new SSLContext((SSLContextSpi) sap.spi, sap.provider, protocol);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Creates a new {@code SSLContext} instance for the specified protocol from
 * the specified provider.
 *
 * @param protocol
 *            the requested protocol to create a context for
 * @param provider
 *            the provider that provides the requested protocol.
 * @return an {@code SSLContext} for the requested protocol.
 * @throws NoSuchAlgorithmException
 *             if the specified provider cannot provide the requested
 *             protocol.
 * @throws NullPointerException
 *             if {@code protocol} is {@code null} (instead of
 *             NoSuchAlgorithmException as in 1.4 release)
 */
public static SSLContext getInstance(String protocol, Provider provider)
    throws NoSuchAlgorithmException {
  if (provider == null) {
    throw new IllegalArgumentException("provider is null");
  }
  if (protocol == null) {
    throw new NullPointerException("protocol == null");
  }
  Object spi = ENGINE.getInstance(protocol, provider, null);
  return new SSLContext((SSLContextSpi) spi, provider, protocol);
}

相关文章