1 /*
2 * Copyright (c) 1998, 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
148 this.certFacSpi = certFacSpi;
149 this.provider = provider;
150 this.type = type;
151 }
152
153 /**
154 * Returns a certificate factory object that implements the
155 * specified certificate type.
156 *
157 * <p> This method traverses the list of registered security Providers,
158 * starting with the most preferred Provider.
159 * A new CertificateFactory object encapsulating the
160 * CertificateFactorySpi implementation from the first
161 * Provider that supports the specified type is returned.
162 *
163 * <p> Note that the list of registered providers may be retrieved via
164 * the {@link Security#getProviders() Security.getProviders()} method.
165 *
166 * @implNote
167 * The JDK Reference Implementation additionally uses the
168 * {@code jdk.security.provider.preferred} property to determine
169 * the preferred provider order for the specified algorithm. This
170 * may be different than the order of providers returned by
171 * {@link Security#getProviders() Security.getProviders()}.
172 *
173 * @param type the name of the requested certificate type.
174 * See the CertificateFactory section in the <a href=
175 * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
176 * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
177 * for information about standard certificate types.
178 *
179 * @return a certificate factory object for the specified type.
180 *
181 * @exception CertificateException if no Provider supports a
182 * CertificateFactorySpi implementation for the
183 * specified type.
184 *
185 * @see java.security.Provider
186 */
187 public static final CertificateFactory getInstance(String type)
188 throws CertificateException {
|
1 /*
2 * Copyright (c) 1998, 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
148 this.certFacSpi = certFacSpi;
149 this.provider = provider;
150 this.type = type;
151 }
152
153 /**
154 * Returns a certificate factory object that implements the
155 * specified certificate type.
156 *
157 * <p> This method traverses the list of registered security Providers,
158 * starting with the most preferred Provider.
159 * A new CertificateFactory object encapsulating the
160 * CertificateFactorySpi implementation from the first
161 * Provider that supports the specified type is returned.
162 *
163 * <p> Note that the list of registered providers may be retrieved via
164 * the {@link Security#getProviders() Security.getProviders()} method.
165 *
166 * @implNote
167 * The JDK Reference Implementation additionally uses the
168 * {@code jdk.security.provider.preferred}
169 * {@link Security#getProperty(String) Security} property to determine
170 * the preferred provider order for the specified algorithm. This
171 * may be different than the order of providers returned by
172 * {@link Security#getProviders() Security.getProviders()}.
173 *
174 * @param type the name of the requested certificate type.
175 * See the CertificateFactory section in the <a href=
176 * "{@docRoot}/../technotes/guides/security/StandardNames.html#CertificateFactory">
177 * Java Cryptography Architecture Standard Algorithm Name Documentation</a>
178 * for information about standard certificate types.
179 *
180 * @return a certificate factory object for the specified type.
181 *
182 * @exception CertificateException if no Provider supports a
183 * CertificateFactorySpi implementation for the
184 * specified type.
185 *
186 * @see java.security.Provider
187 */
188 public static final CertificateFactory getInstance(String type)
189 throws CertificateException {
|