Class PGPUtils

java.lang.Object
org.apache.sshd.openpgp.PGPUtils

public final class PGPUtils extends Object
TODO Add javadoc
  • Field Details

    • DEFAULT_PGP_FILE_SUFFIX

      public static final String DEFAULT_PGP_FILE_SUFFIX
      See Also:
    • STD_LINUX_PGP_FOLDER_NAME

      public static final String STD_LINUX_PGP_FOLDER_NAME
      See Also:
    • STD_WINDOWS_PGP_FOLDER_NAME

      public static final String STD_WINDOWS_PGP_FOLDER_NAME
      See Also:
    • PGP_ENCRYPTED_FILE

      public static final String PGP_ENCRYPTED_FILE
      Default MIME type for PGP encrypted files
      See Also:
    • NO_CIPHER_PLACEHOLDER

      public static final String NO_CIPHER_PLACEHOLDER
      Alias for Unencrypted
      See Also:
    • CIPHERS

      public static final Set<org.c02e.jpgpj.EncryptionAlgorithm> CIPHERS
    • NO_COMPRESSION_PLACEHOLDER

      public static final String NO_COMPRESSION_PLACEHOLDER
      Alias for Uncompressed
      See Also:
    • COMPRESSIONS

      public static final Set<org.c02e.jpgpj.CompressionAlgorithm> COMPRESSIONS
    • DEFAULT_PGP_PATH_RESOLVER_HOLDER

      private static final AtomicReference<Supplier<? extends Path>> DEFAULT_PGP_PATH_RESOLVER_HOLDER
  • Constructor Details

    • PGPUtils

      private PGPUtils()
  • Method Details

    • fromCipherName

      public static org.c02e.jpgpj.EncryptionAlgorithm fromCipherName(String name)
    • fromCompressionName

      public static org.c02e.jpgpj.CompressionAlgorithm fromCompressionName(String name)
    • mapSubKeysByFingerprint

      public static NavigableMap<String,org.c02e.jpgpj.Subkey> mapSubKeysByFingerprint(org.c02e.jpgpj.Key key)
      Parameters:
      key - The Key whose sub-keys to map - ignored if null or no sub-keys available
      Returns:
      A NavigableMap where key=the (case insensitive) fingerprint value, value=the matching Subkey
      Throws:
      NullPointerException - If key with null fingerprint encountered
      IllegalArgumentException - If key with empty fingerprint encountered
      IllegalStateException - If more than one key with same fingerprint found
      See Also:
    • mapSubKeysByFingerprint

      public static NavigableMap<String,org.c02e.jpgpj.Subkey> mapSubKeysByFingerprint(Collection<? extends org.c02e.jpgpj.Subkey> subKeys)
      Parameters:
      subKeys - The Subkey-s to map - ignored if null/empty
      Returns:
      A NavigableMap where key=the (case insensitive) fingerprint value, value=the matching Subkey
      Throws:
      NullPointerException - If key with null fingerprint encountered
      IllegalArgumentException - If key with empty fingerprint encountered
      IllegalStateException - If more than one key with same fingerprint found
    • findSubkeyByFingerprint

      public static org.c02e.jpgpj.Subkey findSubkeyByFingerprint(org.c02e.jpgpj.Key key, String fingerprint)
      Parameters:
      key - The Key whose sub-keys to scan - ignored if null or has no sub-keys
      fingerprint - The fingerprint to match (case insensitive) - ignored if null/empty
      Returns:
      The first matching Subkey - null if no match found
      See Also:
    • findSubkeyByFingerprint

      public static org.c02e.jpgpj.Subkey findSubkeyByFingerprint(Collection<? extends org.c02e.jpgpj.Subkey> subKeys, String fingerprint)
      Parameters:
      subKeys - The Subkey-s to scan - ignored if null/empty
      fingerprint - The fingerprint to match (case insensitive) - ignored if null/empty
      Returns:
      The first matching sub-key - null if no match found
    • getDefaultPgpFolderPath

      public static Path getDefaultPgpFolderPath()
      Returns:
      The default Gnu Privacy Guard folder used to hold key files.
    • setDefaultPgpFolderPathResolver

      public static void setDefaultPgpFolderPathResolver(Supplier<? extends Path> resolver)
      Set the reported value from getDefaultPgpFolderPath()
      Parameters:
      resolver - The Path provider to report - if null then O/S default value will be used