Class UserAuthPublicKey
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.client.auth.AbstractUserAuth
-
- org.apache.sshd.client.auth.pubkey.UserAuthPublicKey
-
- All Implemented Interfaces:
UserAuth,ClientSessionHolder,UserAuthInstance<ClientSession>,NamedResource,SignatureFactoriesHolder,SignatureFactoriesManager
public class UserAuthPublicKey extends AbstractUserAuth implements SignatureFactoriesManager
Implements the "publickey" authentication mechanism
-
-
Field Summary
Fields Modifier and Type Field Description protected PublicKeyIdentitycurrentprotected java.util.List<NamedFactory<Signature>>factoriesprotected java.util.Iterator<PublicKeyIdentity>keysstatic java.lang.StringNAME-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.common.NamedResource
BY_NAME_COMPARATOR, NAME_EXTRACTOR
-
-
Constructor Summary
Constructors Constructor Description UserAuthPublicKey()UserAuthPublicKey(java.util.List<NamedFactory<Signature>> factories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendSignature(ClientSession session, java.lang.String service, java.lang.String name, java.lang.String username, java.lang.String algo, java.security.PublicKey key, Buffer buffer)voiddestroy()Called to release any allocated resourcesjava.util.List<NamedFactory<Signature>>getSignatureFactories()voidinit(ClientSession session, java.lang.String service)protected booleanprocessAuthDataRequest(ClientSession session, java.lang.String service, Buffer buffer)protected voidreleaseKeys()protected booleansendAuthDataRequest(ClientSession session, java.lang.String service)voidsetSignatureFactories(java.util.List<NamedFactory<Signature>> factories)-
Methods inherited from class org.apache.sshd.client.auth.AbstractUserAuth
getClientSession, getName, getService, getSession, process, 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
-
Methods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesHolder
getSignatureFactoriesNameList, getSignatureFactoriesNames
-
Methods inherited from interface org.apache.sshd.common.signature.SignatureFactoriesManager
setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
keys
protected java.util.Iterator<PublicKeyIdentity> keys
-
current
protected PublicKeyIdentity current
-
factories
protected java.util.List<NamedFactory<Signature>> factories
-
-
Constructor Detail
-
UserAuthPublicKey
public UserAuthPublicKey()
-
UserAuthPublicKey
public UserAuthPublicKey(java.util.List<NamedFactory<Signature>> factories)
-
-
Method Detail
-
getSignatureFactories
public java.util.List<NamedFactory<Signature>> getSignatureFactories()
- Specified by:
getSignatureFactoriesin interfaceSignatureFactoriesHolder- Returns:
- The list of named
Signaturefactories
-
setSignatureFactories
public void setSignatureFactories(java.util.List<NamedFactory<Signature>> factories)
- Specified by:
setSignatureFactoriesin interfaceSignatureFactoriesManager
-
init
public void init(ClientSession session, java.lang.String service) throws java.lang.Exception
- Specified by:
initin interfaceUserAuth- Overrides:
initin classAbstractUserAuth- Parameters:
session- TheClientSessionservice- The requesting service name- Throws:
java.lang.Exception- If failed to initialize the mechanism
-
sendAuthDataRequest
protected boolean sendAuthDataRequest(ClientSession session, java.lang.String service) throws java.lang.Exception
- Specified by:
sendAuthDataRequestin classAbstractUserAuth- Throws:
java.lang.Exception
-
processAuthDataRequest
protected boolean processAuthDataRequest(ClientSession session, java.lang.String service, Buffer buffer) throws java.lang.Exception
- Specified by:
processAuthDataRequestin classAbstractUserAuth- Throws:
java.lang.Exception
-
appendSignature
protected void appendSignature(ClientSession session, java.lang.String service, java.lang.String name, java.lang.String username, java.lang.String algo, java.security.PublicKey key, Buffer buffer) throws java.lang.Exception
- Throws:
java.lang.Exception
-
destroy
public void destroy()
Description copied from interface:UserAuthCalled to release any allocated resources- Specified by:
destroyin interfaceUserAuth- Overrides:
destroyin classAbstractUserAuth
-
releaseKeys
protected void releaseKeys() throws java.io.IOException- Throws:
java.io.IOException
-
-