SSH_AUTHSOCKET_ENV_NAME| Constructor and Description |
|---|
AgentImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentity(KeyPair key,
String comment,
SshAgentKeyConstraint... constraints)
Adds a key to the agent.
|
void |
close() |
Iterable<? extends Map.Entry<PublicKey,String>> |
getIdentities() |
protected static Map.Entry<KeyPair,String> |
getKeyPair(Collection<? extends Map.Entry<KeyPair,String>> keys,
PublicKey key) |
boolean |
isOpen() |
void |
removeAllIdentities() |
void |
removeIdentity(PublicKey key) |
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) |
public Iterable<? extends Map.Entry<PublicKey,String>> getIdentities() throws IOException
getIdentities in interface SshAgentIOExceptionpublic Map.Entry<String,byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException
sign in interface SshAgentsession - 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 signIOException - If failed to signpublic void addIdentity(KeyPair key, String comment, SshAgentKeyConstraint... constraints) throws IOException
SshAgentaddIdentity in interface SshAgentkey - KeyPair to addcomment - to associate with the keyconstraints - SshAgentKeyConstraints 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 keypublic KeyPair resolveLocalIdentity(PublicKey key)
SshAgentresolveLocalIdentity in interface SshAgentkey - The PublicKey that is going to be usedKeyPair identity for it - if available - null otherwisepublic void removeIdentity(PublicKey key) throws IOException
removeIdentity in interface SshAgentIOExceptionpublic void removeAllIdentities()
throws IOException
removeAllIdentities in interface SshAgentIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface ChannelIOExceptionCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.