Class Policy.SymmetricKeyAlgorithmPolicy

java.lang.Object
org.pgpainless.policy.Policy.SymmetricKeyAlgorithmPolicy
Enclosing class:
Policy

public static final class Policy.SymmetricKeyAlgorithmPolicy extends Object
  • Constructor Details

  • Method Details

    • getDefaultSymmetricKeyAlgorithm

      public SymmetricKeyAlgorithm getDefaultSymmetricKeyAlgorithm()
      Return the default symmetric key algorithm. This algorithm is used as a fallback when no consensus about symmetric algorithms can be reached.
      Returns:
      default symmetric encryption algorithm
    • isAcceptable

      public boolean isAcceptable(SymmetricKeyAlgorithm algorithm)
      Return true if the given symmetric encryption algorithm is acceptable by this policy.
      Parameters:
      algorithm - algorithm
      Returns:
      true if algorithm is acceptable, false otherwise
    • isAcceptable

      public boolean isAcceptable(int algorithmId)
      Return true if the given symmetric encryption algorithm is acceptable by this policy.
      Parameters:
      algorithmId - algorithm
      Returns:
      true if algorithm is acceptable, false otherwise
    • defaultSymmetricKeyEncryptionAlgorithmPolicy

      @Deprecated public static Policy.SymmetricKeyAlgorithmPolicy defaultSymmetricKeyEncryptionAlgorithmPolicy()
      Deprecated.
      not expressive - will be removed in a future release
      The default symmetric encryption algorithm policy of PGPainless.
      Returns:
      default symmetric encryption algorithm policy
    • symmetricKeyEncryptionPolicy2022

      public static Policy.SymmetricKeyAlgorithmPolicy symmetricKeyEncryptionPolicy2022()
      Policy for symmetric encryption algorithms in the context of message production (encryption). This suite contains algorithms that are deemed safe to use in 2022.
      Returns:
      2022 symmetric key encryption algorithm policy
    • defaultSymmetricKeyDecryptionAlgorithmPolicy

      @Deprecated public static Policy.SymmetricKeyAlgorithmPolicy defaultSymmetricKeyDecryptionAlgorithmPolicy()
      Deprecated.
      not expressive - will be removed in a future update
      The default symmetric decryption algorithm policy of PGPainless.
      Returns:
      default symmetric decryption algorithm policy
    • symmetricKeyDecryptionPolicy2022

      public static Policy.SymmetricKeyAlgorithmPolicy symmetricKeyDecryptionPolicy2022()
      Policy for symmetric key encryption algorithms in the context of message consumption (decryption). This suite contains algorithms that are deemed safe to use in 2022.
      Returns:
      2022 symmetric key decryption algorithm policy
    • selectBest

      public SymmetricKeyAlgorithm selectBest(List<SymmetricKeyAlgorithm> options)
      Select the best acceptable algorithm from the options list. The best algorithm is the first algorithm we encounter in our list of acceptable algorithms that is also contained in the list of options.
      Parameters:
      options - list of algorithm options
      Returns:
      best