Class KeyProviderUtil
java.lang.Object
net.schmizz.sshj.userauth.keyprovider.KeyProviderUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyFormatdetectKeyFileFormat(File location) Attempts to detect how a key file is encoded.static KeyFormatdetectKeyFileFormat(Reader privateKey, boolean separatePubKey) Attempts to detect how a key file is encoded.static KeyFormatdetectKeyFileFormat(String privateKey, boolean separatePubKey) Attempts to detect how a key file is encoded.private static KeyFormatkeyFormatFromHeader(String header, boolean separatePubKey) private static StringreadHeader(Reader privateKey)
-
Constructor Details
-
KeyProviderUtil
public KeyProviderUtil()
-
-
Method Details
-
detectKeyFileFormat
Attempts to detect how a key file is encoded. Return values are consistent with theNamedFactoryimplementations in thekeyproviderpackage.- Parameters:
location- File Path to key- Returns:
- name of the key file format
- Throws:
IOException- Thrown on file processing failures
-
detectKeyFileFormat
public static KeyFormat detectKeyFileFormat(String privateKey, boolean separatePubKey) throws IOException Attempts to detect how a key file is encoded. Return values are consistent with theNamedFactoryimplementations in thekeyproviderpackage.- Parameters:
privateKey- Private key stored in a stringseparatePubKey- Is the public key stored separately from the private key- Returns:
- name of the key file format
- Throws:
IOException- Thrown on file processing failures
-
detectKeyFileFormat
public static KeyFormat detectKeyFileFormat(Reader privateKey, boolean separatePubKey) throws IOException Attempts to detect how a key file is encoded. Return values are consistent with theNamedFactoryimplementations in thekeyproviderpackage.- Parameters:
privateKey- Private key accessible through aReaderseparatePubKey- Is the public key stored separately from the private key- Returns:
- name of the key file format
- Throws:
IOException- Thrown on file processing failures
-
readHeader
- Throws:
IOException
-
keyFormatFromHeader
-