Package org.apache.sshd.openpgp
Class PGPUtils
java.lang.Object
org.apache.sshd.openpgp.PGPUtils
TODO Add javadoc
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set
<org.c02e.jpgpj.EncryptionAlgorithm> static final Set
<org.c02e.jpgpj.CompressionAlgorithm> static final String
private static final AtomicReference
<Supplier<? extends Path>> static final String
Alias forUnencrypted
static final String
Alias forUncompressed
static final String
Default MIME type for PGP encrypted filesstatic final String
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.c02e.jpgpj.Subkey
findSubkeyByFingerprint
(Collection<? extends org.c02e.jpgpj.Subkey> subKeys, String fingerprint) static org.c02e.jpgpj.Subkey
findSubkeyByFingerprint
(org.c02e.jpgpj.Key key, String fingerprint) static org.c02e.jpgpj.EncryptionAlgorithm
fromCipherName
(String name) static org.c02e.jpgpj.CompressionAlgorithm
fromCompressionName
(String name) static Path
static NavigableMap
<String, org.c02e.jpgpj.Subkey> mapSubKeysByFingerprint
(Collection<? extends org.c02e.jpgpj.Subkey> subKeys) static NavigableMap
<String, org.c02e.jpgpj.Subkey> mapSubKeysByFingerprint
(org.c02e.jpgpj.Key key) static void
setDefaultPgpFolderPathResolver
(Supplier<? extends Path> resolver) Set the reported value fromgetDefaultPgpFolderPath()
-
Field Details
-
DEFAULT_PGP_FILE_SUFFIX
- See Also:
-
STD_LINUX_PGP_FOLDER_NAME
- See Also:
-
STD_WINDOWS_PGP_FOLDER_NAME
- See Also:
-
PGP_ENCRYPTED_FILE
Default MIME type for PGP encrypted files- See Also:
-
NO_CIPHER_PLACEHOLDER
Alias forUnencrypted
- See Also:
-
CIPHERS
-
NO_COMPRESSION_PLACEHOLDER
Alias forUncompressed
- See Also:
-
COMPRESSIONS
-
DEFAULT_PGP_PATH_RESOLVER_HOLDER
-
-
Constructor Details
-
PGPUtils
private PGPUtils()
-
-
Method Details
-
fromCipherName
-
fromCompressionName
-
mapSubKeysByFingerprint
public static NavigableMap<String,org.c02e.jpgpj.Subkey> mapSubKeysByFingerprint(org.c02e.jpgpj.Key key) - Parameters:
key
- TheKey
whose sub-keys to map - ignored ifnull
or no sub-keys available- Returns:
- A
NavigableMap
where key=the (case insensitive) fingerprint value, value=the matchingSubkey
- Throws:
NullPointerException
- If key withnull
fingerprint encounteredIllegalArgumentException
- If key with empty fingerprint encounteredIllegalStateException
- 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
- TheSubkey
-s to map - ignored ifnull
/empty- Returns:
- A
NavigableMap
where key=the (case insensitive) fingerprint value, value=the matchingSubkey
- Throws:
NullPointerException
- If key withnull
fingerprint encounteredIllegalArgumentException
- If key with empty fingerprint encounteredIllegalStateException
- 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
- TheKey
whose sub-keys to scan - ignored ifnull
or has no sub-keysfingerprint
- The fingerprint to match (case insensitive) - ignored ifnull
/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
- TheSubkey
-s to scan - ignored ifnull
/emptyfingerprint
- The fingerprint to match (case insensitive) - ignored ifnull
/empty- Returns:
- The first matching sub-key -
null
if no match found
-
getDefaultPgpFolderPath
- Returns:
- The default Gnu Privacy Guard folder used to hold key files.
-
setDefaultPgpFolderPathResolver
Set the reported value fromgetDefaultPgpFolderPath()
- Parameters:
resolver
- ThePath
provider to report - ifnull
then O/S default value will be used
-