public class UserAuthHostBased extends AbstractUserAuth implements SignatureFactoriesManager
Modifier and Type | Field and Description |
---|---|
protected HostKeyIdentityProvider |
clientHostKeys |
protected Map.Entry<KeyPair,? extends Collection<X509Certificate>> |
keyInfo |
protected Iterator<? extends Map.Entry<KeyPair,? extends Collection<X509Certificate>>> |
keys |
static String |
NAME |
log
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
UserAuthHostBased(HostKeyIdentityProvider clientHostKeys) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
appendSignature(ClientSession session,
String service,
String keyType,
PublicKey key,
byte[] keyBytes,
String clientHostname,
String clientUsername,
Signature verifier,
Buffer buffer) |
String |
getClientHostname() |
String |
getClientUsername() |
List<NamedFactory<Signature>> |
getSignatureFactories() |
void |
init(ClientSession session,
String service) |
protected boolean |
processAuthDataRequest(ClientSession session,
String service,
Buffer buffer) |
protected String |
resolveClientHostname(ClientSession session) |
protected String |
resolveClientUsername(ClientSession session) |
protected boolean |
sendAuthDataRequest(ClientSession session,
String service) |
void |
setClientHostname(String clientHostname) |
void |
setClientUsername(String clientUsername) |
void |
setSignatureFactories(List<NamedFactory<Signature>> factories) |
void |
signalAuthMethodFailure(ClientSession session,
String service,
boolean partial,
List<String> serverMethods,
Buffer buffer)
Signals reception of
SSH_MSG_USERAUTH_FAILURE message |
void |
signalAuthMethodSuccess(ClientSession session,
String service,
Buffer buffer)
Signal reception of
SSH_MSG_USERAUTH_SUCCESS message |
destroy, getClientSession, getName, getService, getSession, process, toString
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSignatureFactories, resolveSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
getSignatureFactoriesNameList, getSignatureFactoriesNames
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
public static final String NAME
protected Iterator<? extends Map.Entry<KeyPair,? extends Collection<X509Certificate>>> keys
protected Map.Entry<KeyPair,? extends Collection<X509Certificate>> keyInfo
protected final HostKeyIdentityProvider clientHostKeys
public UserAuthHostBased(HostKeyIdentityProvider clientHostKeys)
public void init(ClientSession session, String service) throws Exception
init
in interface UserAuth
init
in class AbstractUserAuth
session
- The ClientSession
service
- The requesting service nameException
- If failed to initialize the mechanismpublic List<NamedFactory<Signature>> getSignatureFactories()
getSignatureFactories
in interface SignatureFactoriesHolder
Signature
factoriespublic void setSignatureFactories(List<NamedFactory<Signature>> factories)
setSignatureFactories
in interface SignatureFactoriesManager
public String getClientUsername()
public void setClientUsername(String clientUsername)
public String getClientHostname()
public void setClientHostname(String clientHostname)
protected boolean sendAuthDataRequest(ClientSession session, String service) throws Exception
sendAuthDataRequest
in class AbstractUserAuth
Exception
protected byte[] appendSignature(ClientSession session, String service, String keyType, PublicKey key, byte[] keyBytes, String clientHostname, String clientUsername, Signature verifier, Buffer buffer) throws Exception
Exception
protected boolean processAuthDataRequest(ClientSession session, String service, Buffer buffer) throws Exception
processAuthDataRequest
in class AbstractUserAuth
Exception
public void signalAuthMethodSuccess(ClientSession session, String service, Buffer buffer) throws Exception
UserAuth
SSH_MSG_USERAUTH_SUCCESS
messagesignalAuthMethodSuccess
in interface UserAuth
session
- The ClientSession
service
- The requesting service namebuffer
- The Buffer
containing the success message (after having consumed the relevant data from
it)Exception
- If failed to handle the callback - Note: may cause session closepublic void signalAuthMethodFailure(ClientSession session, String service, boolean partial, List<String> serverMethods, Buffer buffer) throws Exception
UserAuth
SSH_MSG_USERAUTH_FAILURE
messagesignalAuthMethodFailure
in interface UserAuth
session
- The ClientSession
service
- The requesting service namepartial
- true
if some partial authentication success so farserverMethods
- The List
of authentication methods that can continuebuffer
- The Buffer
containing the failure message (after having consumed the relevant data
from it)Exception
- If failed to handle the callback - Note: may cause session closeprotected String resolveClientUsername(ClientSession session)
protected String resolveClientHostname(ClientSession session)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.