Class JGitPublicKeyAuthentication
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.client.auth.AbstractUserAuth
-
- org.apache.sshd.client.auth.pubkey.UserAuthPublicKey
-
- org.eclipse.jgit.internal.transport.sshd.JGitPublicKeyAuthentication
-
- All Implemented Interfaces:
org.apache.sshd.client.auth.UserAuth
,org.apache.sshd.client.session.ClientSessionHolder
,org.apache.sshd.common.auth.UserAuthInstance<org.apache.sshd.client.session.ClientSession>
,org.apache.sshd.common.NamedResource
,org.apache.sshd.common.signature.SignatureFactoriesHolder
,org.apache.sshd.common.signature.SignatureFactoriesManager
public class JGitPublicKeyAuthentication extends org.apache.sshd.client.auth.pubkey.UserAuthPublicKey
CustomUserAuthPublicKey
implementation for handling SSH config PubkeyAcceptedAlgorithms and interaction with the SSH agent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JGitPublicKeyAuthentication.KeyIterator
-
Field Summary
Fields Modifier and Type Field Description private boolean
addKeysToAgent
private org.apache.sshd.agent.SshAgent
agent
private boolean
askBeforeAdding
private org.apache.sshd.agent.SshAgentKeyConstraint[]
constraints
private org.apache.sshd.client.config.hosts.HostConfigEntry
hostConfig
private java.lang.String
skProvider
-
Constructor Summary
Constructors Constructor Description JGitPublicKeyAuthentication(java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.signature.Signature>> factories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
agentHasKey(java.security.PublicKey pk)
protected java.util.Iterator<org.apache.sshd.client.auth.pubkey.PublicKeyIdentity>
createPublicKeyIterator(org.apache.sshd.client.session.ClientSession session, org.apache.sshd.common.signature.SignatureFactoriesManager manager)
private org.apache.sshd.agent.SshAgent
getAgent(org.apache.sshd.client.session.ClientSession session)
private org.apache.sshd.client.auth.pubkey.PublicKeyIdentity
getNextKey(org.apache.sshd.client.session.ClientSession session, java.lang.String service)
private URIish
getUri()
void
init(org.apache.sshd.client.session.ClientSession rawSession, java.lang.String service)
private void
parseAddKeys(org.apache.sshd.client.config.hosts.HostConfigEntry config)
protected void
releaseKeys()
protected org.apache.sshd.client.auth.pubkey.PublicKeyIdentity
resolveAttemptedPublicKeyIdentity(org.apache.sshd.client.session.ClientSession session, java.lang.String service)
-
Methods inherited from class org.apache.sshd.client.auth.pubkey.UserAuthPublicKey
appendSignature, destroy, getDefaultSignatureAlgorithm, getSignatureFactories, processAuthDataRequest, resolveAttemptedPublicKeyIdentity, sendAuthDataRequest, setSignatureFactories, signalAuthMethodFailure, signalAuthMethodSuccess
-
Methods inherited from class org.apache.sshd.client.auth.AbstractUserAuth
getClientSession, getName, getService, getSession, isCancellable, process, setCancellable, toString
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
agent
private org.apache.sshd.agent.SshAgent agent
-
hostConfig
private org.apache.sshd.client.config.hosts.HostConfigEntry hostConfig
-
addKeysToAgent
private boolean addKeysToAgent
-
askBeforeAdding
private boolean askBeforeAdding
-
skProvider
private java.lang.String skProvider
-
constraints
private org.apache.sshd.agent.SshAgentKeyConstraint[] constraints
-
-
Method Detail
-
init
public void init(org.apache.sshd.client.session.ClientSession rawSession, java.lang.String service) throws java.lang.Exception
- Specified by:
init
in interfaceorg.apache.sshd.client.auth.UserAuth
- Overrides:
init
in classorg.apache.sshd.client.auth.pubkey.UserAuthPublicKey
- Throws:
java.lang.Exception
-
createPublicKeyIterator
protected java.util.Iterator<org.apache.sshd.client.auth.pubkey.PublicKeyIdentity> createPublicKeyIterator(org.apache.sshd.client.session.ClientSession session, org.apache.sshd.common.signature.SignatureFactoriesManager manager) throws java.lang.Exception
- Overrides:
createPublicKeyIterator
in classorg.apache.sshd.client.auth.pubkey.UserAuthPublicKey
- Throws:
java.lang.Exception
-
resolveAttemptedPublicKeyIdentity
protected org.apache.sshd.client.auth.pubkey.PublicKeyIdentity resolveAttemptedPublicKeyIdentity(org.apache.sshd.client.session.ClientSession session, java.lang.String service) throws java.lang.Exception
- Overrides:
resolveAttemptedPublicKeyIdentity
in classorg.apache.sshd.client.auth.pubkey.UserAuthPublicKey
- Throws:
java.lang.Exception
-
getNextKey
private org.apache.sshd.client.auth.pubkey.PublicKeyIdentity getNextKey(org.apache.sshd.client.session.ClientSession session, java.lang.String service) throws java.lang.Exception
- Throws:
java.lang.Exception
-
agentHasKey
private boolean agentHasKey(java.security.PublicKey pk) throws java.io.IOException
- Throws:
java.io.IOException
-
getUri
private URIish getUri()
-
getAgent
private org.apache.sshd.agent.SshAgent getAgent(org.apache.sshd.client.session.ClientSession session) throws java.lang.Exception
- Throws:
java.lang.Exception
-
parseAddKeys
private void parseAddKeys(org.apache.sshd.client.config.hosts.HostConfigEntry config)
-
releaseKeys
protected void releaseKeys() throws java.io.IOException
- Overrides:
releaseKeys
in classorg.apache.sshd.client.auth.pubkey.UserAuthPublicKey
- Throws:
java.io.IOException
-
-