< prev index next >

src/java.base/share/classes/com/sun/net/ssl/KeyManagerFactory.java

Print this page
rev 51919 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: dfuchs, alanb


 136 
 137     /**
 138      * Generates a <code>KeyManagerFactory</code> object for the specified
 139      * key management algorithm from the specified provider.
 140      *
 141      * @param algorithm the standard name of the requested
 142      * algorithm.
 143      * @param provider the name of the provider
 144      *
 145      * @return the new <code>KeyManagerFactory</code> object
 146      *
 147      * @exception NoSuchAlgorithmException if the specified algorithm is not
 148      * available from the specified provider.
 149      * @exception NoSuchProviderException if the specified provider has not
 150      * been configured.
 151      */
 152     public static final KeyManagerFactory getInstance(String algorithm,
 153                                                  String provider)
 154         throws NoSuchAlgorithmException, NoSuchProviderException
 155     {
 156         if (provider == null || provider.length() == 0)
 157             throw new IllegalArgumentException("missing provider");
 158         Object[] objs = SSLSecurity.getImpl(algorithm, "KeyManagerFactory",
 159                                             provider);
 160         return new KeyManagerFactory((KeyManagerFactorySpi)objs[0],
 161                                         (Provider)objs[1], algorithm);
 162     }
 163 
 164     /**
 165      * Generates a <code>KeyManagerFactory</code> object for the specified
 166      * key management algorithm from the specified provider.
 167      *
 168      * @param algorithm the standard name of the requested
 169      * algorithm.
 170      * @param provider an instance of the provider
 171      *
 172      * @return the new <code>KeyManagerFactory</code> object
 173      *
 174      * @exception NoSuchAlgorithmException if the specified algorithm is not
 175      * available from the specified provider.
 176      */




 136 
 137     /**
 138      * Generates a <code>KeyManagerFactory</code> object for the specified
 139      * key management algorithm from the specified provider.
 140      *
 141      * @param algorithm the standard name of the requested
 142      * algorithm.
 143      * @param provider the name of the provider
 144      *
 145      * @return the new <code>KeyManagerFactory</code> object
 146      *
 147      * @exception NoSuchAlgorithmException if the specified algorithm is not
 148      * available from the specified provider.
 149      * @exception NoSuchProviderException if the specified provider has not
 150      * been configured.
 151      */
 152     public static final KeyManagerFactory getInstance(String algorithm,
 153                                                  String provider)
 154         throws NoSuchAlgorithmException, NoSuchProviderException
 155     {
 156         if (provider == null || provider.isEmpty())
 157             throw new IllegalArgumentException("missing provider");
 158         Object[] objs = SSLSecurity.getImpl(algorithm, "KeyManagerFactory",
 159                                             provider);
 160         return new KeyManagerFactory((KeyManagerFactorySpi)objs[0],
 161                                         (Provider)objs[1], algorithm);
 162     }
 163 
 164     /**
 165      * Generates a <code>KeyManagerFactory</code> object for the specified
 166      * key management algorithm from the specified provider.
 167      *
 168      * @param algorithm the standard name of the requested
 169      * algorithm.
 170      * @param provider an instance of the provider
 171      *
 172      * @return the new <code>KeyManagerFactory</code> object
 173      *
 174      * @exception NoSuchAlgorithmException if the specified algorithm is not
 175      * available from the specified provider.
 176      */


< prev index next >