Skip to content

Commit 1ffbe78

Browse files
martinuyfranferrax
andcommitted
Add implementation notes to public APIs
Update public APIs documentation with implementation notes to reflect the effect of the jdk.security.providers.filter Security and System properties. Co-authored-by: Martin Balao Alonso <[email protected]> Co-authored-by: Francisco Ferrari Bihurriet <[email protected]>
1 parent 1f23330 commit 1ffbe78

31 files changed

+1032
-199
lines changed

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,20 @@ public final String getAlgorithm() {
148148
* the {@link Security#getProviders() Security.getProviders()} method.
149149
*
150150
* @implNote
151-
* The JDK Reference Implementation additionally uses the
152-
* {@code jdk.security.provider.preferred}
153-
* {@link Security#getProperty(String) Security} property to determine
154-
* the preferred provider order for the specified algorithm. This
155-
* may be different from the order of providers returned by
156-
* {@link Security#getProviders() Security.getProviders()}.
151+
* The JDK Reference Implementation additionally uses the following
152+
* properties to customize the behavior of this method:
153+
* <ul>
154+
* <li> The {@code jdk.security.provider.preferred}
155+
* {@link Security#getProperty(String) Security} property determines
156+
* the preferred provider order for the specified algorithm.
157+
* This may be different from the order of providers returned by
158+
* {@link Security#getProviders() Security.getProviders()}.</li>
159+
* <li> The {@code jdk.security.providers.filter}
160+
* {@link System#getProperty(String) System} and
161+
* {@link Security#getProperty(String) Security} properties determine
162+
* which services are enabled. A service that is not enabled by the
163+
* filter will not make its algorithm implementation available.</li>
164+
* </ul>
157165
*
158166
* @param algorithm the name of the algorithm this
159167
* parameter generator is associated with.
@@ -201,6 +209,14 @@ public static AlgorithmParameterGenerator getInstance(String algorithm)
201209
* <p> Note that the list of registered providers may be retrieved via
202210
* the {@link Security#getProviders() Security.getProviders()} method.
203211
*
212+
* @implNote
213+
* The JDK Reference Implementation additionally uses the
214+
* {@code jdk.security.providers.filter}
215+
* {@link System#getProperty(String) System} and
216+
* {@link Security#getProperty(String) Security} properties to determine
217+
* which services are enabled. A service that is not enabled by the filter
218+
* will not make its algorithm implementation available.
219+
*
204220
* @param algorithm the name of the algorithm this
205221
* parameter generator is associated with.
206222
* See the AlgorithmParameterGenerator section in the <a href=
@@ -252,6 +268,14 @@ public static AlgorithmParameterGenerator getInstance(String algorithm,
252268
* provider is returned. Note that the specified provider does not
253269
* have to be registered in the provider list.
254270
*
271+
* @implNote
272+
* The JDK Reference Implementation additionally uses the
273+
* {@code jdk.security.providers.filter}
274+
* {@link System#getProperty(String) System} and
275+
* {@link Security#getProperty(String) Security} properties to determine
276+
* which services are enabled. A service that is not enabled by the filter
277+
* will not make its algorithm implementation available.
278+
*
255279
* @param algorithm the string name of the algorithm this
256280
* parameter generator is associated with.
257281
* See the AlgorithmParameterGenerator section in the <a href=

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,20 @@ public final String getAlgorithm() {
135135
* parameter encoding.
136136
*
137137
* @implNote
138-
* The JDK Reference Implementation additionally uses the
139-
* {@code jdk.security.provider.preferred}
140-
* {@link Security#getProperty(String) Security} property to determine
141-
* the preferred provider order for the specified algorithm. This
142-
* may be different from the order of providers returned by
143-
* {@link Security#getProviders() Security.getProviders()}.
138+
* The JDK Reference Implementation additionally uses the following
139+
* properties to customize the behavior of this method:
140+
* <ul>
141+
* <li> The {@code jdk.security.provider.preferred}
142+
* {@link Security#getProperty(String) Security} property determines
143+
* the preferred provider order for the specified algorithm.
144+
* This may be different from the order of providers returned by
145+
* {@link Security#getProviders() Security.getProviders()}.</li>
146+
* <li> The {@code jdk.security.providers.filter}
147+
* {@link System#getProperty(String) System} and
148+
* {@link Security#getProperty(String) Security} properties determine
149+
* which services are enabled. A service that is not enabled by the
150+
* filter will not make its algorithm implementation available.</li>
151+
* </ul>
144152
*
145153
* @param algorithm the name of the algorithm requested.
146154
* See the AlgorithmParameters section in the <a href=
@@ -188,6 +196,14 @@ public static AlgorithmParameters getInstance(String algorithm)
188196
* {@code init}, using an appropriate parameter specification or
189197
* parameter encoding.
190198
*
199+
* @implNote
200+
* The JDK Reference Implementation additionally uses the
201+
* {@code jdk.security.providers.filter}
202+
* {@link System#getProperty(String) System} and
203+
* {@link Security#getProperty(String) Security} properties to determine
204+
* which services are enabled. A service that is not enabled by the filter
205+
* will not make its algorithm implementation available.
206+
*
191207
* @param algorithm the name of the algorithm requested.
192208
* See the AlgorithmParameters section in the <a href=
193209
* "{@docRoot}/../specs/security/standard-names.html#algorithmparameters-algorithms">
@@ -239,6 +255,14 @@ public static AlgorithmParameters getInstance(String algorithm,
239255
* {@code init}, using an appropriate parameter specification or
240256
* parameter encoding.
241257
*
258+
* @implNote
259+
* The JDK Reference Implementation additionally uses the
260+
* {@code jdk.security.providers.filter}
261+
* {@link System#getProperty(String) System} and
262+
* {@link Security#getProperty(String) Security} properties to determine
263+
* which services are enabled. A service that is not enabled by the filter
264+
* will not make its algorithm implementation available.
265+
*
242266
* @param algorithm the name of the algorithm requested.
243267
* See the AlgorithmParameters section in the <a href=
244268
* "{@docRoot}/../specs/security/standard-names.html#algorithmparameters-algorithms">

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,20 @@ private KeyFactory(String algorithm) throws NoSuchAlgorithmException {
157157
* the {@link Security#getProviders() Security.getProviders()} method.
158158
*
159159
* @implNote
160-
* The JDK Reference Implementation additionally uses the
161-
* {@code jdk.security.provider.preferred}
162-
* {@link Security#getProperty(String) Security} property to determine
163-
* the preferred provider order for the specified algorithm. This
164-
* may be different from the order of providers returned by
165-
* {@link Security#getProviders() Security.getProviders()}.
160+
* The JDK Reference Implementation additionally uses the following
161+
* properties to customize the behavior of this method:
162+
* <ul>
163+
* <li> The {@code jdk.security.provider.preferred}
164+
* {@link Security#getProperty(String) Security} property determines
165+
* the preferred provider order for the specified algorithm.
166+
* This may be different from the order of providers returned by
167+
* {@link Security#getProviders() Security.getProviders()}.</li>
168+
* <li> The {@code jdk.security.providers.filter}
169+
* {@link System#getProperty(String) System} and
170+
* {@link Security#getProperty(String) Security} properties determine
171+
* which services are enabled. A service that is not enabled by the
172+
* filter will not make its algorithm implementation available.</li>
173+
* </ul>
166174
*
167175
* @param algorithm the name of the requested key algorithm.
168176
* See the KeyFactory section in the <a href=
@@ -199,6 +207,14 @@ public static KeyFactory getInstance(String algorithm)
199207
* <p> Note that the list of registered providers may be retrieved via
200208
* the {@link Security#getProviders() Security.getProviders()} method.
201209
*
210+
* @implNote
211+
* The JDK Reference Implementation additionally uses the
212+
* {@code jdk.security.providers.filter}
213+
* {@link System#getProperty(String) System} and
214+
* {@link Security#getProperty(String) Security} properties to determine
215+
* which services are enabled. A service that is not enabled by the filter
216+
* will not make its algorithm implementation available.
217+
*
202218
* @param algorithm the name of the requested key algorithm.
203219
* See the KeyFactory section in the <a href=
204220
* "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">
@@ -242,6 +258,14 @@ public static KeyFactory getInstance(String algorithm, String provider)
242258
* is returned. Note that the specified provider does not
243259
* have to be registered in the provider list.
244260
*
261+
* @implNote
262+
* The JDK Reference Implementation additionally uses the
263+
* {@code jdk.security.providers.filter}
264+
* {@link System#getProperty(String) System} and
265+
* {@link Security#getProperty(String) Security} properties to determine
266+
* which services are enabled. A service that is not enabled by the filter
267+
* will not make its algorithm implementation available.
268+
*
245269
* @param algorithm the name of the requested key algorithm.
246270
* See the KeyFactory section in the <a href=
247271
* "{@docRoot}/../specs/security/standard-names.html#keyfactory-algorithms">

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,20 @@ private static KeyPairGenerator getInstance(Instance instance,
204204
* the {@link Security#getProviders() Security.getProviders()} method.
205205
*
206206
* @implNote
207-
* The JDK Reference Implementation additionally uses the
208-
* {@code jdk.security.provider.preferred}
209-
* {@link Security#getProperty(String) Security} property to determine
210-
* the preferred provider order for the specified algorithm. This
211-
* may be different from the order of providers returned by
212-
* {@link Security#getProviders() Security.getProviders()}.
207+
* The JDK Reference Implementation additionally uses the following
208+
* properties to customize the behavior of this method:
209+
* <ul>
210+
* <li> The {@code jdk.security.provider.preferred}
211+
* {@link Security#getProperty(String) Security} property determines
212+
* the preferred provider order for the specified algorithm.
213+
* This may be different from the order of providers returned by
214+
* {@link Security#getProviders() Security.getProviders()}.</li>
215+
* <li> The {@code jdk.security.providers.filter}
216+
* {@link System#getProperty(String) System} and
217+
* {@link Security#getProperty(String) Security} properties determine
218+
* which services are enabled. A service that is not enabled by the
219+
* filter will not make its algorithm implementation available.</li>
220+
* </ul>
213221
*
214222
* @param algorithm the standard string name of the algorithm.
215223
* See the KeyPairGenerator section in the <a href=
@@ -269,6 +277,14 @@ public static KeyPairGenerator getInstance(String algorithm)
269277
* <p> Note that the list of registered providers may be retrieved via
270278
* the {@link Security#getProviders() Security.getProviders()} method.
271279
*
280+
* @implNote
281+
* The JDK Reference Implementation additionally uses the
282+
* {@code jdk.security.providers.filter}
283+
* {@link System#getProperty(String) System} and
284+
* {@link Security#getProperty(String) Security} properties to determine
285+
* which services are enabled. A service that is not enabled by the filter
286+
* will not make its algorithm implementation available.
287+
*
272288
* @param algorithm the standard string name of the algorithm.
273289
* See the KeyPairGenerator section in the <a href=
274290
* "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">
@@ -312,6 +328,14 @@ public static KeyPairGenerator getInstance(String algorithm,
312328
* is returned. Note that the specified provider does not
313329
* have to be registered in the provider list.
314330
*
331+
* @implNote
332+
* The JDK Reference Implementation additionally uses the
333+
* {@code jdk.security.providers.filter}
334+
* {@link System#getProperty(String) System} and
335+
* {@link Security#getProperty(String) Security} properties to determine
336+
* which services are enabled. A service that is not enabled by the filter
337+
* will not make its algorithm implementation available.
338+
*
315339
* @param algorithm the standard string name of the algorithm.
316340
* See the KeyPairGenerator section in the <a href=
317341
* "{@docRoot}/../specs/security/standard-names.html#keypairgenerator-algorithms">

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

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -842,12 +842,20 @@ private String getProviderName() {
842842
* the {@link Security#getProviders() Security.getProviders()} method.
843843
*
844844
* @implNote
845-
* The JDK Reference Implementation additionally uses the
846-
* {@code jdk.security.provider.preferred}
847-
* {@link Security#getProperty(String) Security} property to determine
848-
* the preferred provider order for the specified algorithm. This
849-
* may be different from the order of providers returned by
850-
* {@link Security#getProviders() Security.getProviders()}.
845+
* The JDK Reference Implementation additionally uses the following
846+
* properties to customize the behavior of this method:
847+
* <ul>
848+
* <li> The {@code jdk.security.provider.preferred}
849+
* {@link Security#getProperty(String) Security} property determines
850+
* the preferred provider order for the specified type.
851+
* This may be different from the order of providers returned by
852+
* {@link Security#getProviders() Security.getProviders()}.</li>
853+
* <li> The {@code jdk.security.providers.filter}
854+
* {@link System#getProperty(String) System} and
855+
* {@link Security#getProperty(String) Security} properties determine
856+
* which services are enabled. A service that is not enabled by the
857+
* filter will not make its type implementation available.</li>
858+
* </ul>.
851859
*
852860
* @param type the type of keystore.
853861
* See the KeyStore section in the <a href=
@@ -889,6 +897,14 @@ public static KeyStore getInstance(String type)
889897
* <p> Note that the list of registered providers may be retrieved via
890898
* the {@link Security#getProviders() Security.getProviders()} method.
891899
*
900+
* @implNote
901+
* The JDK Reference Implementation additionally uses the
902+
* {@code jdk.security.providers.filter}
903+
* {@link System#getProperty(String) System} and
904+
* {@link Security#getProperty(String) Security} properties to determine
905+
* which services are enabled. A service that is not enabled by the filter
906+
* will not make its type implementation available.
907+
*
892908
* @param type the type of keystore.
893909
* See the KeyStore section in the <a href=
894910
* "{@docRoot}/../specs/security/standard-names.html#keystore-types">
@@ -936,6 +952,14 @@ public static KeyStore getInstance(String type, String provider)
936952
* object is returned. Note that the specified provider object
937953
* does not have to be registered in the provider list.
938954
*
955+
* @implNote
956+
* The JDK Reference Implementation additionally uses the
957+
* {@code jdk.security.providers.filter}
958+
* {@link System#getProperty(String) System} and
959+
* {@link Security#getProperty(String) Security} properties to determine
960+
* which services are enabled. A service that is not enabled by the filter
961+
* will not make its type implementation available.
962+
*
939963
* @param type the type of keystore.
940964
* See the KeyStore section in the <a href=
941965
* "{@docRoot}/../specs/security/standard-names.html#keystore-types">
@@ -1678,6 +1702,14 @@ public final void setEntry(String alias, Entry entry,
16781702
* <p> Note that the list of registered providers may be retrieved via
16791703
* the {@link Security#getProviders() Security.getProviders()} method.
16801704
*
1705+
* @implNote
1706+
* The JDK Reference Implementation additionally uses the
1707+
* {@code jdk.security.providers.filter}
1708+
* {@link System#getProperty(String) System} and
1709+
* {@link Security#getProperty(String) Security} properties to determine
1710+
* which services are enabled. A service that is not enabled by the filter
1711+
* will not make its type implementation available.
1712+
*
16811713
* @param file the keystore file
16821714
* @param password the keystore password, which may be {@code null}
16831715
*
@@ -1731,6 +1763,14 @@ public static final KeyStore getInstance(File file, char[] password)
17311763
* <p> Note that the list of registered providers may be retrieved via
17321764
* the {@link Security#getProviders() Security.getProviders()} method.
17331765
*
1766+
* @implNote
1767+
* The JDK Reference Implementation additionally uses the
1768+
* {@code jdk.security.providers.filter}
1769+
* {@link System#getProperty(String) System} and
1770+
* {@link Security#getProperty(String) Security} properties to determine
1771+
* which services are enabled. A service that is not enabled by the filter
1772+
* will not make its type implementation available.
1773+
*
17341774
* @param file the keystore file
17351775
* @param param the {@code LoadStoreParameter} that specifies how to load
17361776
* the keystore, which may be {@code null}

0 commit comments

Comments
 (0)