Class OpenPgpKeyAttributeUtil


  • public final class OpenPgpKeyAttributeUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Set<org.pgpainless.algorithm.HashAlgorithm> getOrGuessPreferredHashAlgorithms​(org.bouncycastle.openpgp.PGPPublicKey publicKey)
      Try to extract hash algorithm preferences from self signatures.
      static java.util.List<org.pgpainless.algorithm.HashAlgorithm> getPreferredHashAlgorithms​(org.bouncycastle.openpgp.PGPPublicKey publicKey)  
      static java.util.List<org.pgpainless.algorithm.HashAlgorithm> guessPreferredHashAlgorithms​(org.bouncycastle.openpgp.PGPPublicKey publicKey)
      Return the hash algorithm that was used in the latest self signature.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getPreferredHashAlgorithms

        public static java.util.List<org.pgpainless.algorithm.HashAlgorithm> getPreferredHashAlgorithms​(org.bouncycastle.openpgp.PGPPublicKey publicKey)
      • guessPreferredHashAlgorithms

        public static java.util.List<org.pgpainless.algorithm.HashAlgorithm> guessPreferredHashAlgorithms​(org.bouncycastle.openpgp.PGPPublicKey publicKey)
        Return the hash algorithm that was used in the latest self signature.
        Parameters:
        publicKey - public key
        Returns:
        list of hash algorithm
      • getOrGuessPreferredHashAlgorithms

        public static java.util.Set<org.pgpainless.algorithm.HashAlgorithm> getOrGuessPreferredHashAlgorithms​(org.bouncycastle.openpgp.PGPPublicKey publicKey)
        Try to extract hash algorithm preferences from self signatures. If no self-signature containing hash algorithm preferences is found, try to derive a hash algorithm preference by inspecting the hash algorithm used by existing self-signatures.
        Parameters:
        publicKey - key
        Returns:
        hash algorithm preferences (might be empty!)