public interface SshAgent
extends java.nio.channels.Channel
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
SSH_AUTHSOCKET_ENV_NAME |
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentity(java.security.KeyPair key,
java.lang.String comment,
SshAgentKeyConstraint... constraints)
Adds a key to the agent.
|
java.lang.Iterable<? extends java.util.Map.Entry<java.security.PublicKey,java.lang.String>> |
getIdentities() |
void |
removeAllIdentities() |
void |
removeIdentity(java.security.PublicKey key) |
default java.security.KeyPair |
resolveLocalIdentity(java.security.PublicKey key)
Used for reporting client-side public key authentication via agent
|
java.util.Map.Entry<java.lang.String,byte[]> |
sign(SessionContext session,
java.security.PublicKey key,
java.lang.String algo,
byte[] data) |
static final java.lang.String SSH_AUTHSOCKET_ENV_NAME
java.lang.Iterable<? extends java.util.Map.Entry<java.security.PublicKey,java.lang.String>> getIdentities()
throws java.io.IOException
java.io.IOExceptionjava.util.Map.Entry<java.lang.String,byte[]> sign(SessionContext session, java.security.PublicKey key, java.lang.String algo, byte[] data) throws java.io.IOException
session - The current SessionContextkey - The PublicKey to use for signingalgo - Recommended signature algorithm - if null/empty then one will be selected based on
the key type and/or signature factories. Note: even if specific algorithm specified,
the implementation may disregard and choose anotherdata - Data to signjava.io.IOException - If failed to signdefault java.security.KeyPair resolveLocalIdentity(java.security.PublicKey key)
key - The PublicKey that is going to be usedKeyPair identity for it - if available - null otherwisevoid addIdentity(java.security.KeyPair key,
java.lang.String comment,
SshAgentKeyConstraint... constraints)
throws java.io.IOException
key - KeyPair to addcomment - to associate with the keyconstraints - SshAgentKeyConstraints for this key to pass on to the agentjava.io.IOException - if an error in the communication with the agent occurred, or the agent did not return a reply
indicating successful addition of the keyvoid removeIdentity(java.security.PublicKey key)
throws java.io.IOException
java.io.IOExceptionvoid removeAllIdentities()
throws java.io.IOException
java.io.IOException