public class SSHAgent extends Object
Modifier and Type | Field and Description |
---|---|
protected com.jcraft.jsch.JSch |
jsch
JSSch instance.
|
protected Map<String,char[]> |
passphraseForKeys
Passphrase associated to key file path.
|
Modifier and Type | Method and Description |
---|---|
protected char[] |
askPassphrase(String privatekeyFile,
String message)
Ask for passphrase.
|
static SSHAgent |
getAgent()
Get agent instance.
|
char[] |
getPassphrase(File privatekeyFile)
Get passphrase for key.
|
char[] |
getPassphrase(String privatekeyFile)
Get passphrase for key.
|
protected static byte[] |
toBytes(char[] chars)
Transform char array to byte array without creating String instance.
|
public static SSHAgent getAgent()
public char[] getPassphrase(File privatekeyFile) throws InvalidPassphraseException
privatekeyFile
- private key fileInvalidPassphraseException
- if user cancel authenticationpublic char[] getPassphrase(String privatekeyFile) throws InvalidPassphraseException
privatekeyFile
- private key file pathInvalidPassphraseException
- if user cancel authenticationprotected char[] askPassphrase(String privatekeyFile, String message) throws InvalidPassphraseException
privatekeyFile
- private key file pathmessage
- messageInvalidPassphraseException
- if user cancel authenticationprotected static byte[] toBytes(char[] chars)
chars
- char arrayCopyright © 1999–2020 CodeLutin. All rights reserved.