Class Policy


  • public final class Policy
    extends java.lang.Object
    Policy class used to configure acceptable algorithm suites etc.
    • Method Detail

      • getInstance

        public static Policy getInstance()
        Return the singleton instance of PGPainless' policy.
        Returns:
        singleton instance
      • getSignatureHashAlgorithmPolicy

        public Policy.HashAlgorithmPolicy getSignatureHashAlgorithmPolicy()
        Return the hash algorithm policy for signatures.
        Returns:
        hash algorithm policy
      • setSignatureHashAlgorithmPolicy

        public void setSignatureHashAlgorithmPolicy​(Policy.HashAlgorithmPolicy policy)
        Set a custom hash algorithm policy for signatures.
        Parameters:
        policy - custom policy
      • getRevocationSignatureHashAlgorithmPolicy

        public Policy.HashAlgorithmPolicy getRevocationSignatureHashAlgorithmPolicy()
        Return the hash algorithm policy for revocations. This policy is separate from getSignatureHashAlgorithmPolicy(), as PGPainless by default uses a less strict policy when it comes to acceptable algorithms.
        Returns:
        revocation signature hash algorithm policy
      • setRevocationSignatureHashAlgorithmPolicy

        public void setRevocationSignatureHashAlgorithmPolicy​(Policy.HashAlgorithmPolicy policy)
        Set a custom hash algorithm policy for revocations.
        Parameters:
        policy - custom policy
      • getSymmetricKeyEncryptionAlgorithmPolicy

        public Policy.SymmetricKeyAlgorithmPolicy getSymmetricKeyEncryptionAlgorithmPolicy()
        Return the symmetric encryption algorithm policy for encryption. This policy defines which symmetric algorithms are acceptable when producing encrypted messages.
        Returns:
        symmetric algorithm policy for encryption
      • getSymmetricKeyDecryptionAlgoritmPolicy

        public Policy.SymmetricKeyAlgorithmPolicy getSymmetricKeyDecryptionAlgoritmPolicy()
        Return the symmetric encryption algorithm policy for decryption. This policy defines which symmetric algorithms are acceptable when decrypting encrypted messages.
        Returns:
        symmetric algorithm policy for decryption
      • setSymmetricKeyEncryptionAlgorithmPolicy

        public void setSymmetricKeyEncryptionAlgorithmPolicy​(Policy.SymmetricKeyAlgorithmPolicy policy)
        Set a custom symmetric encryption algorithm policy for encrypting messages.
        Parameters:
        policy - custom policy
      • setSymmetricKeyDecryptionAlgorithmPolicy

        public void setSymmetricKeyDecryptionAlgorithmPolicy​(Policy.SymmetricKeyAlgorithmPolicy policy)
        Set a custom symmetric encryption algorithm policy for decrypting messages.
        Parameters:
        policy - custom policy
      • getNotationRegistry

        public NotationRegistry getNotationRegistry()
        Return the NotationRegistry of PGPainless. The notation registry is used to decide, whether or not a Notation is known or not. Background: Critical unknown notations render signatures invalid.
        Returns:
        Notation registry