Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
    
    
  
  
    
    
    
    AlgorithmConstraints
    interface AlgorithmConstraints
    
    This interface specifies constraints for cryptographic algorithms, keys (key sizes), and other algorithm parameters. 
     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.
    Summary
    
      
        
          | Public methods | 
        
          | abstract Boolean | Determines whether an algorithm is granted permission for the specified cryptographic primitives. | 
        
          | abstract Boolean | Determines whether an algorithm and the corresponding key are granted permission for the specified cryptographic primitives. | 
        
          | abstract Boolean | Determines whether a key is granted permission for the specified cryptographic primitives. | 
      
    
    Public methods
    
      permits
      
      abstract fun permits(
    primitives: MutableSet<CryptoPrimitive!>!, 
    algorithm: String!, 
    parameters: AlgorithmParameters!
): Boolean
      Determines whether an algorithm is granted permission for the specified cryptographic primitives.
      
      
        
          
            | Return | 
          
            | Boolean | true if the algorithm is permitted and can be used for all of the specified cryptographic primitives | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if primitives or algorithm is null or empty | 
        
      
     
    
      permits
      
      abstract fun permits(
    primitives: MutableSet<CryptoPrimitive!>!, 
    algorithm: String!, 
    key: Key!, 
    parameters: AlgorithmParameters!
): Boolean
      Determines whether an algorithm and the corresponding key are granted permission for the specified cryptographic primitives.
      
      
        
          
            | Return | 
          
            | Boolean | true if the key and the algorithm can be used for all of the specified cryptographic primitives | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if primitives or algorithm is null or empty, or the key is null | 
        
      
     
    
      permits
      
      abstract fun permits(
    primitives: MutableSet<CryptoPrimitive!>!, 
    key: Key!
): Boolean
      Determines whether a key is granted permission for the specified cryptographic primitives. 
       This method is usually used to check key size and key usage.
      
      
        
          
            | Return | 
          
            | Boolean | true if the key can be used for all of the specified cryptographic primitives | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if primitives is null or empty, or the key is null | 
        
      
     
  
  
  
    
  
 
  
    
      
      
    
    
      
    
    
  
       
    
    
      
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]