Class Policy.HashAlgorithmPolicy

  • Enclosing class:
    Policy

    public static final class Policy.HashAlgorithmPolicy
    extends java.lang.Object
    • Constructor Detail

      • HashAlgorithmPolicy

        public HashAlgorithmPolicy​(HashAlgorithm defaultHashAlgorithm,
                                   java.util.List<HashAlgorithm> acceptableHashAlgorithms)
    • Method Detail

      • defaultHashAlgorithm

        public HashAlgorithm defaultHashAlgorithm()
        Return the default hash algorithm. This algorithm is used as a fallback when no consensus about hash algorithms can be reached.
        Returns:
        default hash algorithm
      • isAcceptable

        public boolean isAcceptable​(HashAlgorithm hashAlgorithm)
        Return true if the the given hash algorithm is acceptable by this policy.
        Parameters:
        hashAlgorithm - hash algorithm
        Returns:
        true if the hash algorithm is acceptable, false otherwise
      • isAcceptable

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

        public static Policy.HashAlgorithmPolicy defaultSignatureAlgorithmPolicy()
        The default signature hash algorithm policy of PGPainless. Note that this policy is only used for non-revocation signatures. For revocation signatures defaultRevocationSignatureHashAlgorithmPolicy() is used instead.
        Returns:
        default signature hash algorithm policy
      • defaultRevocationSignatureHashAlgorithmPolicy

        public static Policy.HashAlgorithmPolicy defaultRevocationSignatureHashAlgorithmPolicy()
        The default revocation signature hash algorithm policy of PGPainless.
        Returns:
        default revocation signature hash algorithm policy