public class MaverickAgent extends java.lang.Object implements SshAgent
AUTO_AGENT_SOCKET_TYPE, AUTO_PROTOCOL, NAMED_PIPED_AGENT_SOCKET_TYPE, OPENSSH_PROTOCOL, RFC_PROTOCOL, TCPIP_AGENT_SOCKET_TYPE, UNIX_DOMAIN_AGENT_SOCKET_TYPE| Constructor and Description |
|---|
MaverickAgent(java.lang.String application,
java.lang.String location,
int socketType,
int protocol) |
| Modifier and Type | Method and Description |
|---|---|
void |
addKey(SshKeyPair keyPair,
java.lang.String description)
Add a key to the agent.
|
void |
channelCreated(SshChannel channel)
Called when a new channel with a supported name has been created.
|
void |
close() |
SshChannel.ChannelData |
createChannel(java.lang.String channelName,
byte[] requestData)
Called when a new channel with a supported name has been created.
|
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
|
com.maverick.agent.client.SshAgentClient |
getAgent() |
byte[] |
getRandomData(int count)
Request some random data from the remote side
|
java.lang.String[] |
getSupportChannelNames()
Get the names of the channels this factory supports.
|
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
|
public MaverickAgent(java.lang.String application,
java.lang.String location,
int socketType,
int protocol)
throws SshException
SshExceptionpublic com.maverick.agent.client.SshAgentClient getAgent()
public java.lang.String[] getSupportChannelNames()
SshChannelHandlergetSupportChannelNames in interface SshChannelHandlerpublic SshChannel.ChannelData createChannel(java.lang.String channelName, byte[] requestData)
SshChannelHandlercreateChannel in interface SshChannelHandlerchannelName - channel namerequestData - request datanull for nonepublic void channelCreated(SshChannel channel) throws java.io.IOException
SshChannelHandlerchannelCreated in interface SshChannelHandlerchannel - channeljava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic void addKey(SshKeyPair keyPair, java.lang.String description) throws SshException
SshAgentaddKey in interface SshAgentdescription - descriptionSshExceptionpublic java.util.Map listKeys()
throws SshException
SshAgentlistKeys in interface SshAgentSshException - if an error occurspublic boolean lockAgent(java.lang.String password)
throws SshException
SshAgentlockAgent in interface SshAgentpassword - password that will be required to unlockSshException - if an error occurspublic boolean unlockAgent(java.lang.String password)
throws SshException
SshAgentunlockAgent in interface SshAgentpassword - the password to unlockSshException - if an error occurspublic byte[] getRandomData(int count)
throws SshException
SshAgentgetRandomData in interface SshAgentcount - the number of bytes neededSshException - if an error occurspublic void deleteKey(SshPublicKey key, java.lang.String description) throws SshException
SshAgentdeleteKey in interface SshAgentkey - the public key of the private key to deletedescription - the description of the keySshException - if an error occurspublic byte[] hashAndSign(SshPublicKey key, byte[] data) throws SshException
SshAgenthashAndSign in interface SshAgentkey - the public key of the required private keydata - the data to has and signSshException - if an error occurspublic void deleteAllKeys()
throws SshException
SshAgentdeleteAllKeys in interface SshAgentSshException - if an error occurspublic void ping(byte[] padding)
throws SshException
SshAgentping in interface SshAgentpadding - the padding dataSshExceptionCopyright © 2018. All rights reserved.