Class KeyProviderUtil
- java.lang.Object
-
- net.schmizz.sshj.userauth.keyprovider.KeyProviderUtil
-
public class KeyProviderUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KeyProviderUtil()
-
Method Summary
Modifier and Type Method Description static KeyFormatdetectKeyFileFormat(java.io.File location)Attempts to detect how a key file is encoded.static KeyFormatdetectKeyFileFormat(java.io.Reader privateKey, boolean separatePubKey)Attempts to detect how a key file is encoded.static KeyFormatdetectKeyFileFormat(java.lang.String privateKey, boolean separatePubKey)Attempts to detect how a key file is encoded.
-
-
-
Method Detail
-
detectKeyFileFormat
public static KeyFormat detectKeyFileFormat(java.io.File location) throws java.io.IOException
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:
java.io.IOException- Thrown on file processing failures
-
detectKeyFileFormat
public static KeyFormat detectKeyFileFormat(java.lang.String privateKey, boolean separatePubKey) throws java.io.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:
java.io.IOException- Thrown on file processing failures
-
detectKeyFileFormat
public static KeyFormat detectKeyFileFormat(java.io.Reader privateKey, boolean separatePubKey) throws java.io.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:
java.io.IOException- Thrown on file processing failures
-
-