public interface SshAgent extends SshChannelHandler, java.io.Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
AUTO_AGENT_SOCKET_TYPE
Try to automatically determine the socket type.
|
static int |
AUTO_PROTOCOL
Attempt to determine protocol automatically, falling back to
OPENSSH_PROTOCOL if not possible. |
static int |
NAMED_PIPED_AGENT_SOCKET_TYPE
Use a windows named pipe for communication with agent.
|
static int |
OPENSSH_PROTOCOL
OpenSSH and the de-facto standard
|
static int |
RFC_PROTOCOL
RFC agent protocol.
|
static int |
TCPIP_AGENT_SOCKET_TYPE
Use a TCP/IP socket for communication with agent.
|
static int |
UNIX_DOMAIN_AGENT_SOCKET_TYPE
Use a domain socket for communication with agent.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKey(SshKeyPair keyPair,
java.lang.String description)
Add a key to the agent.
|
void |
deleteAllKeys()
Delete all the keys held by the agent.
|
void |
deleteKey(SshPublicKey key,
java.lang.String description)
Delete a key held by the agent
|
byte[] |
getRandomData(int count)
Request some random data from the remote side
|
byte[] |
hashAndSign(SshPublicKey key,
byte[] data)
Request a hash and sign operation be performed for a given public key.
|
java.util.Map |
listKeys()
List all the keys on the agent.
|
boolean |
lockAgent(java.lang.String password)
Lock the agent
|
void |
ping(byte[] padding)
Ping the remote side with some random padding data
|
boolean |
unlockAgent(java.lang.String password)
Unlock the agent
|
channelCreated, createChannel, getSupportChannelNamesstatic final int OPENSSH_PROTOCOL
static final int RFC_PROTOCOL
static final int AUTO_PROTOCOL
OPENSSH_PROTOCOL if not possible. NOTE: No providers can currently
implement auto-detection due to a code clash used by the two different
protocols. Both use code 9, with the RFC version using it as the FIRST
request to determine protocol version. However, OpenSSH uses the code for
removing all keys! This makes detection of protocol in use hard.static final int AUTO_AGENT_SOCKET_TYPE
static final int TCPIP_AGENT_SOCKET_TYPE
static final int UNIX_DOMAIN_AGENT_SOCKET_TYPE
static final int NAMED_PIPED_AGENT_SOCKET_TYPE
void addKey(SshKeyPair keyPair, java.lang.String description) throws SshException, java.lang.UnsupportedOperationException
keypair - keypairdescription - descriptionjava.lang.UnsupportedOperationException - if keys cannot be added using this APISshExceptionjava.util.Map listKeys()
throws SshException
SshException - if an error occursboolean lockAgent(java.lang.String password)
throws SshException
password - password that will be required to unlockSshException - if an error occursboolean unlockAgent(java.lang.String password)
throws SshException
password - the password to unlockSshException - if an error occursbyte[] getRandomData(int count)
throws SshException
count - the number of bytes neededSshException - if an error occursvoid deleteKey(SshPublicKey key, java.lang.String description) throws SshException
key - the public key of the private key to deletedescription - the description of the keySshException - if an error occursbyte[] hashAndSign(SshPublicKey key, byte[] data) throws SshException
key - the public key of the required private keydata - the data to has and signSshException - if an error occursvoid deleteAllKeys()
throws SshException
SshException - if an error occursvoid ping(byte[] padding) throws SshException
padding - the padding dataIOException - if an IO error occursSshExceptionCopyright © 2018. All rights reserved.