< prev index next >
src/java.base/share/classes/javax/net/ssl/KeyManagerFactory.java
Print this page
rev 15967 : [mq]: GetInstance
*** 25,34 ****
--- 25,35 ----
package javax.net.ssl;
import java.security.Security;
import java.security.*;
+ import java.util.Objects;
import sun.security.jca.GetInstance;
/**
* This class acts as a factory for key managers based on a
*** 128,148 ****
* See the <a href=
* "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
! * @return the new <code>KeyManagerFactory</code> object.
*
! * @exception NoSuchAlgorithmException if no Provider supports a
! * KeyManagerFactorySpi implementation for the
! * specified algorithm.
! * @exception NullPointerException if <code>algorithm</code> is null.
*
* @see java.security.Provider
*/
public static final KeyManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
GetInstance.Instance instance = GetInstance.getInstance
("KeyManagerFactory", KeyManagerFactorySpi.class,
algorithm);
return new KeyManagerFactory((KeyManagerFactorySpi)instance.impl,
instance.provider, algorithm);
--- 129,151 ----
* See the <a href=
* "{@docRoot}/../technotes/guides/security/jsse/JSSERefGuide.html">
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
! * @return the new {@code KeyManagerFactory} object
*
! * @throws NoSuchAlgorithmException if no {@code Provider} supports a
! * {@code KeyManagerFactorySpi} implementation for the
! * specified algorithm
! *
! * @throws NullPointerException if {@code algorithm} is {@code null}
*
* @see java.security.Provider
*/
public static final KeyManagerFactory getInstance(String algorithm)
throws NoSuchAlgorithmException {
+ Objects.requireNonNull(algorithm, "null algorithm name");
GetInstance.Instance instance = GetInstance.getInstance
("KeyManagerFactory", KeyManagerFactorySpi.class,
algorithm);
return new KeyManagerFactory((KeyManagerFactorySpi)instance.impl,
instance.provider, algorithm);
*** 166,192 ****
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider the name of the provider.
*
! * @return the new <code>KeyManagerFactory</code> object.
*
! * @throws NoSuchAlgorithmException if a KeyManagerFactorySpi
* implementation for the specified algorithm is not
! * available from the specified provider.
*
* @throws NoSuchProviderException if the specified provider is not
! * registered in the security provider list.
*
! * @throws IllegalArgumentException if the provider name is null or empty.
! * @throws NullPointerException if <code>algorithm</code> is null.
*
* @see java.security.Provider
*/
public static final KeyManagerFactory getInstance(String algorithm,
String provider) throws NoSuchAlgorithmException,
NoSuchProviderException {
GetInstance.Instance instance = GetInstance.getInstance
("KeyManagerFactory", KeyManagerFactorySpi.class,
algorithm, provider);
return new KeyManagerFactory((KeyManagerFactorySpi)instance.impl,
instance.provider, algorithm);
--- 169,198 ----
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider the name of the provider.
*
! * @return the new {@code KeyManagerFactory} object
! *
! * @throws IllegalArgumentException if the provider name is {@code null}
! * or empty
*
! * @throws NoSuchAlgorithmException if a {@code KeyManagerFactorySpi}
* implementation for the specified algorithm is not
! * available from the specified provider
*
* @throws NoSuchProviderException if the specified provider is not
! * registered in the security provider list
*
! * @throws NullPointerException if {@code algorithm} is {@code null}
*
* @see java.security.Provider
*/
public static final KeyManagerFactory getInstance(String algorithm,
String provider) throws NoSuchAlgorithmException,
NoSuchProviderException {
+ Objects.requireNonNull(algorithm, "null algorithm name");
GetInstance.Instance instance = GetInstance.getInstance
("KeyManagerFactory", KeyManagerFactorySpi.class,
algorithm, provider);
return new KeyManagerFactory((KeyManagerFactorySpi)instance.impl,
instance.provider, algorithm);
*** 207,229 ****
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider an instance of the provider.
*
! * @return the new <code>KeyManagerFactory</code> object.
*
! * @throws NoSuchAlgorithmException if a KeyManagerFactorySpi
* implementation for the specified algorithm is not available
! * from the specified Provider object.
*
! * @throws IllegalArgumentException if provider is null.
! * @throws NullPointerException if <code>algorithm</code> is null.
*
* @see java.security.Provider
*/
public static final KeyManagerFactory getInstance(String algorithm,
Provider provider) throws NoSuchAlgorithmException {
GetInstance.Instance instance = GetInstance.getInstance
("KeyManagerFactory", KeyManagerFactorySpi.class,
algorithm, provider);
return new KeyManagerFactory((KeyManagerFactorySpi)instance.impl,
instance.provider, algorithm);
--- 213,237 ----
* Java Secure Socket Extension Reference Guide </a>
* for information about standard algorithm names.
*
* @param provider an instance of the provider.
*
! * @return the new {@code KeyManagerFactory} object
! *
! * @throws IllegalArgumentException if provider is {@code null}
*
! * @throws NoSuchAlgorithmException if a {@code @KeyManagerFactorySpi}
* implementation for the specified algorithm is not available
! * from the specified Provider object
*
! * @throws NullPointerException if {@code algorithm} is {@code null}
*
* @see java.security.Provider
*/
public static final KeyManagerFactory getInstance(String algorithm,
Provider provider) throws NoSuchAlgorithmException {
+ Objects.requireNonNull(algorithm, "null algorithm name");
GetInstance.Instance instance = GetInstance.getInstance
("KeyManagerFactory", KeyManagerFactorySpi.class,
algorithm, provider);
return new KeyManagerFactory((KeyManagerFactorySpi)instance.impl,
instance.provider, algorithm);
< prev index next >