Top Description Inners Fields Constructors Methods
org.eclipse.jgit.internal.transport.sshd

public Class JGitPublicKeyAuthentication

extends UserAuthPublicKey
Class Inheritance
Static Imports
java.text.MessageFormat.format, org.eclipse.jgit.transport.SshConstants.NONE, .SshConstants.PKCS11_PROVIDER, .SshConstants.PKCS11_SLOT_LIST_INDEX, .SshConstants.PUBKEY_ACCEPTED_ALGORITHMS

Custom UserAuthPublicKey implementation for handling SSH config PubkeyAcceptedAlgorithms and interaction with the SSH agent and PKCS11 providers.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private boolean
private SshAgent
private boolean
private SshAgentKeyConstraint[]
private HostConfigEntry
private static final String
private String
Inherited from org.apache.sshd.client.auth.pubkey.UserAuthPublicKey:
chosenAlgorithmcurrentcurrentAlgorithmsfactoriesIDENTITY_AGENTkeysNAMEUSE_DEFAULT_IDENTITIES

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean
protected Iterator<PublicKeyIdentity>
private SshAgent
private URIish
public void
private void
protected void
protected PublicKeyIdentity
Inherited from org.apache.sshd.client.auth.pubkey.UserAuthPublicKey:
appendSignaturedestroygetDefaultSignatureAlgorithmgetSignatureFactoriesprocessAuthDataRequestresolveAttemptedPublicKeyIdentitysendAuthDataRequestsetSignatureFactoriessignalAuthMethodFailuresignalAuthMethodSuccess

Field Detail

addKeysToAgentback to summary
private boolean addKeysToAgent
agentback to summary
private SshAgent agent
askBeforeAddingback to summary
private boolean askBeforeAdding
constraintsback to summary
private SshAgentKeyConstraint[] constraints
hostConfigback to summary
private HostConfigEntry hostConfig
LOG_FORMATback to summary
private static final String LOG_FORMAT
skProviderback to summary
private String skProvider

Constructor Detail

JGitPublicKeyAuthenticationback to summary
pack-priv JGitPublicKeyAuthentication(List<NamedFactory<Signature>> factories)

Method Detail

agentHasKeyback to summary
private boolean agentHasKey(PublicKey pk) throws IOException
createPublicKeyIteratorback to summary
protected Iterator<PublicKeyIdentity> createPublicKeyIterator(ClientSession session, SignatureFactoriesManager manager) throws Exception

Overrides org.apache.sshd.client.auth.pubkey.UserAuthPublicKey.createPublicKeyIterator.

Annotations
@Override
getAgentback to summary
private SshAgent getAgent(ClientSession session) throws Exception
getUriback to summary
private URIish getUri()
initback to summary
public void init(ClientSession rawSession, String service) throws Exception

Overrides org.apache.sshd.client.auth.pubkey.UserAuthPublicKey.init.

Implements org.apache.sshd.client.auth.UserAuth.init.

Parameters
rawSession:ClientSession

Doc from org.apache.sshd.client.auth.UserAuth.init.

The ClientSession

service:String

Doc from org.apache.sshd.client.auth.UserAuth.init.

The requesting service name

Annotations
@Override
Exceptions
Exception:

Doc from org.apache.sshd.client.auth.UserAuth.init.

If failed to initialize the mechanism

parseAddKeysback to summary
private void parseAddKeys(HostConfigEntry config)
releaseKeysback to summary
protected void releaseKeys() throws IOException

Overrides org.apache.sshd.client.auth.pubkey.UserAuthPublicKey.releaseKeys.

Annotations
@Override
resolveAttemptedPublicKeyIdentityback to summary
protected PublicKeyIdentity resolveAttemptedPublicKeyIdentity(ClientSession session, String service) throws Exception

Overrides org.apache.sshd.client.auth.pubkey.UserAuthPublicKey.resolveAttemptedPublicKeyIdentity.

Annotations
@Override
org.eclipse.jgit.internal.transport.sshd back to summary

private Class JGitPublicKeyAuthentication.KeyIterator

extends UserAuthPublicKeyIterator
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private Iterable<KeyAgentIdentity>
private List<PublicKey>
private Iterable<KeyAgentIdentity>
private Collection<PublicKey>
protected Iterable<KeyAgentIdentity>
private PublicKey

Returns:

the public key read from the key file
readPublicKey
(String
the path to a public key
keyFile
,
boolean
false in case the given keyFile is set in the SSH config as is, otherwise false
isDerived
)

Inherited from org.apache.sshd.client.auth.pubkey.UserAuthPublicKeyIterator:
closecloseAgenthasNextinitializeSessionIdentitiesisOpennext

Field Detail

PUB_KEY_SUFFIXback to summary
private static final String PUB_KEY_SUFFIX

Constructor Detail

KeyIteratorback to summary
public KeyIterator(ClientSession session, SignatureFactoriesManager manager) throws Exception

Method Detail

checkCancellationback to summary
private void checkCancellation(Throwable e)
getAgentIdentitiesback to summary
private Iterable<KeyAgentIdentity> getAgentIdentities() throws IOException
getExplicitKeysback to summary
private List<PublicKey> getExplicitKeys(Collection<String> explicitFiles)
getPkcs11Keysback to summary
private Iterable<KeyAgentIdentity> getPkcs11Keys() throws IOException
identitiesOnlyback to summary
private Collection<PublicKey> identitiesOnly()
initializeAgentIdentitiesback to summary
protected Iterable<KeyAgentIdentity> initializeAgentIdentities(ClientSession session) throws IOException

Overrides org.apache.sshd.client.auth.pubkey.UserAuthPublicKeyIterator.initializeAgentIdentities.

Annotations
@Override
readPublicKeyback to summary
private PublicKey readPublicKey(String keyFile, boolean isDerived)
Parameters
keyFile:String

the path to a public key

isDerived:boolean

false in case the given keyFile is set in the SSH config as is, otherwise false

Returns:PublicKey

the public key read from the key file