public interface SshAgent extends Channel
Modifier and Type | Field and Description |
---|---|
static String |
SSH_AUTHSOCKET_ENV_NAME |
Modifier and Type | Method and Description |
---|---|
void |
addIdentity(KeyPair key,
String comment,
SshAgentKeyConstraint... constraints)
Adds a key to the agent.
|
Iterable<? extends Map.Entry<PublicKey,String>> |
getIdentities() |
void |
removeAllIdentities() |
void |
removeIdentity(PublicKey key) |
default KeyPair |
resolveLocalIdentity(PublicKey key)
Used for reporting client-side public key authentication via agent
|
Map.Entry<String,byte[]> |
sign(SessionContext session,
PublicKey key,
String algo,
byte[] data) |
static final String SSH_AUTHSOCKET_ENV_NAME
Iterable<? extends Map.Entry<PublicKey,String>> getIdentities() throws IOException
IOException
Map.Entry<String,byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException
session
- The current SessionContext
key
- 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 signIOException
- If failed to signdefault KeyPair resolveLocalIdentity(PublicKey key)
void addIdentity(KeyPair key, String comment, SshAgentKeyConstraint... constraints) throws IOException
key
- KeyPair
to addcomment
- to associate with the keyconstraints
- SshAgentKeyConstraint
s for this key to pass on to the agentIOException
- 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(PublicKey key) throws IOException
IOException
void removeAllIdentities() throws IOException
IOException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.