Package net.schmizz.sshj.userauth.method
Class AuthGssApiWithMic
- java.lang.Object
-
- net.schmizz.sshj.userauth.method.AbstractAuthMethod
-
- net.schmizz.sshj.userauth.method.AuthGssApiWithMic
-
- All Implemented Interfaces:
SSHPacketHandler
,AuthMethod
public class AuthGssApiWithMic extends AbstractAuthMethod
Implements authentication by GSS-API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
AuthGssApiWithMic.InitializeContextAction
PrivilegedExceptionAction to be executed within the given LoginContext for initializing the GSSContext.
-
Field Summary
Fields Modifier and Type Field Description private javax.security.auth.login.LoginContext
loginContext
private org.ietf.jgss.GSSManager
manager
private java.util.List<org.ietf.jgss.Oid>
mechanismOids
private org.ietf.jgss.GSSContext
secContext
-
Fields inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
log, params
-
-
Constructor Summary
Constructors Constructor Description AuthGssApiWithMic(javax.security.auth.login.LoginContext loginContext, java.util.List<org.ietf.jgss.Oid> mechanismOids)
AuthGssApiWithMic(javax.security.auth.login.LoginContext loginContext, java.util.List<org.ietf.jgss.Oid> mechanismOids, org.ietf.jgss.GSSManager manager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSHPacket
buildReq()
Builds aSSHPacket
containing the fields common to all authentication method.private byte[]
generateMIC()
void
handle(Message cmd, SSHPacket buf)
Delegate handling of some SSH packet to this object.private void
handleContextInitialization(SSHPacket buf)
private byte[]
handleTokenFromServer(SSHPacket buf)
private void
sendToken(byte[] token)
-
Methods inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
getName, init, makeAccountResource, request, setLoggerFactory, shouldRetry
-
-
-
-
Constructor Detail
-
AuthGssApiWithMic
public AuthGssApiWithMic(javax.security.auth.login.LoginContext loginContext, java.util.List<org.ietf.jgss.Oid> mechanismOids)
-
AuthGssApiWithMic
public AuthGssApiWithMic(javax.security.auth.login.LoginContext loginContext, java.util.List<org.ietf.jgss.Oid> mechanismOids, org.ietf.jgss.GSSManager manager)
-
-
Method Detail
-
buildReq
public SSHPacket buildReq() throws UserAuthException
Description copied from class:AbstractAuthMethod
Builds aSSHPacket
containing the fields common to all authentication method. Method-specific fields can further be put into this buffer.- Overrides:
buildReq
in classAbstractAuthMethod
- Throws:
UserAuthException
-
sendToken
private void sendToken(byte[] token) throws TransportException
- Throws:
TransportException
-
handleContextInitialization
private void handleContextInitialization(SSHPacket buf) throws UserAuthException, TransportException
- Throws:
UserAuthException
TransportException
-
handleTokenFromServer
private byte[] handleTokenFromServer(SSHPacket buf) throws UserAuthException
- Throws:
UserAuthException
-
generateMIC
private byte[] generateMIC() throws UserAuthException
- Throws:
UserAuthException
-
handle
public void handle(Message cmd, SSHPacket buf) throws UserAuthException, TransportException
Description copied from interface:SSHPacketHandler
Delegate handling of some SSH packet to this object.- Specified by:
handle
in interfaceSSHPacketHandler
- Overrides:
handle
in classAbstractAuthMethod
- Parameters:
cmd
- the SSHmessage identifier
buf
-SSHPacket
containing rest of the request- Throws:
UserAuthException
TransportException
-
-