public interface AlgorithmConstraints
AlgorithmConstraints
objects are immutable. An implementation of this interface should not provide methods that can change the state of an instance once it has been created.
Note that AlgorithmConstraints
can be used to represent the restrictions described by the security properties jdk.certpath.disabledAlgorithms
and jdk.tls.disabledAlgorithms
, or could be used by a concrete PKIXCertPathChecker
to check whether a specified certificate in the certification path contains the required algorithm constraints.
Modifier and Type | Method | Description |
---|---|---|
boolean |
permits |
Determines whether an algorithm is granted permission for the specified cryptographic primitives. |
boolean |
permits |
Determines whether an algorithm and the corresponding key are granted permission for the specified cryptographic primitives. |
boolean |
permits |
Determines whether a key is granted permission for the specified cryptographic primitives. |
boolean permits(Set<CryptoPrimitive> primitives, String algorithm, AlgorithmParameters parameters)
primitives
- a set of cryptographic primitivesalgorithm
- the algorithm nameparameters
- the algorithm parameters, or null
if no additional parameterstrue
if the algorithm is permitted and can be used for all the specified cryptographic primitivesIllegalArgumentException
- if primitives or algorithm is null
or emptyboolean permits(Set<CryptoPrimitive> primitives, Key key)
This method is usually used to check key size and key usage.
primitives
- a set of cryptographic primitiveskey
- the keytrue
if the key can be used for all the specified cryptographic primitivesIllegalArgumentException
- if primitives is null
or empty, or the key is null
boolean permits(Set<CryptoPrimitive> primitives, String algorithm, Key key, AlgorithmParameters parameters)
primitives
- a set of cryptographic primitivesalgorithm
- the algorithm namekey
- the keyparameters
- the algorithm parameters, or null
if no additional parameterstrue
if the key and the algorithm can be used for all the specified cryptographic primitivesIllegalArgumentException
- if primitives or algorithm is null
or empty, or the key is null
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/security/AlgorithmConstraints.html