1 /*
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
111 }
112
113 /**
114 * Returns a parameter object for the specified algorithm.
115 *
116 * <p> This method traverses the list of registered security Providers,
117 * starting with the most preferred Provider.
118 * A new AlgorithmParameters object encapsulating the
119 * AlgorithmParametersSpi implementation from the first
120 * Provider that supports the specified algorithm is returned.
121 *
122 * <p> Note that the list of registered providers may be retrieved via
123 * the {@link Security#getProviders() Security.getProviders()} method.
124 *
125 * <p> The returned parameter object must be initialized via a call to
126 * {@code init}, using an appropriate parameter specification or
127 * parameter encoding.
128 *
129 * @implNote
130 * The JDK Reference Implementation additionally uses the
131 * {@code jdk.security.provider.preferred} property to determine
132 * the preferred provider order for the specified algorithm. This
133 * may be different than the order of providers returned by
134 * {@link Security#getProviders() Security.getProviders()}.
135 *
136 * @param algorithm the name of the algorithm requested.
137 * See the AlgorithmParameters section in the <a href=
138 * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
139 * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
140 * for information about standard algorithm names.
141 *
142 * @return the new parameter object.
143 *
144 * @exception NoSuchAlgorithmException if no Provider supports an
145 * AlgorithmParametersSpi implementation for the
146 * specified algorithm.
147 *
148 * @see Provider
149 */
150 public static AlgorithmParameters getInstance(String algorithm)
151 throws NoSuchAlgorithmException {
|
1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
111 }
112
113 /**
114 * Returns a parameter object for the specified algorithm.
115 *
116 * <p> This method traverses the list of registered security Providers,
117 * starting with the most preferred Provider.
118 * A new AlgorithmParameters object encapsulating the
119 * AlgorithmParametersSpi implementation from the first
120 * Provider that supports the specified algorithm is returned.
121 *
122 * <p> Note that the list of registered providers may be retrieved via
123 * the {@link Security#getProviders() Security.getProviders()} method.
124 *
125 * <p> The returned parameter object must be initialized via a call to
126 * {@code init}, using an appropriate parameter specification or
127 * parameter encoding.
128 *
129 * @implNote
130 * The JDK Reference Implementation additionally uses the
131 * {@code jdk.security.provider.preferred}
132 * {@link Security#getProperty(String) Security} property to determine
133 * the preferred provider order for the specified algorithm. This
134 * may be different than the order of providers returned by
135 * {@link Security#getProviders() Security.getProviders()}.
136 *
137 * @param algorithm the name of the algorithm requested.
138 * See the AlgorithmParameters section in the <a href=
139 * "{@docRoot}/../technotes/guides/security/StandardNames.html#AlgorithmParameters">
140 * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
141 * for information about standard algorithm names.
142 *
143 * @return the new parameter object.
144 *
145 * @exception NoSuchAlgorithmException if no Provider supports an
146 * AlgorithmParametersSpi implementation for the
147 * specified algorithm.
148 *
149 * @see Provider
150 */
151 public static AlgorithmParameters getInstance(String algorithm)
152 throws NoSuchAlgorithmException {
|