< prev index next >

src/java.base/share/classes/java/security/KeyPairGenerator.java

Print this page




 180         }
 181 
 182         return kpg;
 183     }
 184 
 185     /**
 186      * Returns a KeyPairGenerator object that generates public/private
 187      * key pairs for the specified algorithm.
 188      *
 189      * <p> This method traverses the list of registered security Providers,
 190      * starting with the most preferred Provider.
 191      * A new KeyPairGenerator object encapsulating the
 192      * KeyPairGeneratorSpi implementation from the first
 193      * Provider that supports the specified algorithm is returned.
 194      *
 195      * <p> Note that the list of registered providers may be retrieved via
 196      * the {@link Security#getProviders() Security.getProviders()} method.
 197      *
 198      * @implNote
 199      * The JDK Reference Implementation additionally uses the
 200      * {@code jdk.security.provider.preferred} property to determine

 201      * the preferred provider order for the specified algorithm. This
 202      * may be different than the order of providers returned by
 203      * {@link Security#getProviders() Security.getProviders()}.
 204      *
 205      * @param algorithm the standard string name of the algorithm.
 206      * See the KeyPairGenerator section in the <a href=
 207      * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
 208      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
 209      * for information about standard algorithm names.
 210      *
 211      * @return the new KeyPairGenerator object.
 212      *
 213      * @exception NoSuchAlgorithmException if no Provider supports a
 214      *          KeyPairGeneratorSpi implementation for the
 215      *          specified algorithm.
 216      *
 217      * @see Provider
 218      */
 219     public static KeyPairGenerator getInstance(String algorithm)
 220             throws NoSuchAlgorithmException {




 180         }
 181 
 182         return kpg;
 183     }
 184 
 185     /**
 186      * Returns a KeyPairGenerator object that generates public/private
 187      * key pairs for the specified algorithm.
 188      *
 189      * <p> This method traverses the list of registered security Providers,
 190      * starting with the most preferred Provider.
 191      * A new KeyPairGenerator object encapsulating the
 192      * KeyPairGeneratorSpi implementation from the first
 193      * Provider that supports the specified algorithm is returned.
 194      *
 195      * <p> Note that the list of registered providers may be retrieved via
 196      * the {@link Security#getProviders() Security.getProviders()} method.
 197      *
 198      * @implNote
 199      * The JDK Reference Implementation additionally uses the
 200      * {@code jdk.security.provider.preferred}
 201      * {@link Security#getProperty(String) Security} property to determine
 202      * the preferred provider order for the specified algorithm. This
 203      * may be different than the order of providers returned by
 204      * {@link Security#getProviders() Security.getProviders()}.
 205      *
 206      * @param algorithm the standard string name of the algorithm.
 207      * See the KeyPairGenerator section in the <a href=
 208      * "{@docRoot}/../technotes/guides/security/StandardNames.html#KeyPairGenerator">
 209      * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
 210      * for information about standard algorithm names.
 211      *
 212      * @return the new KeyPairGenerator object.
 213      *
 214      * @exception NoSuchAlgorithmException if no Provider supports a
 215      *          KeyPairGeneratorSpi implementation for the
 216      *          specified algorithm.
 217      *
 218      * @see Provider
 219      */
 220     public static KeyPairGenerator getInstance(String algorithm)
 221             throws NoSuchAlgorithmException {


< prev index next >