public class HostBasedUserAuth
extends com.jcraft.jsch.UserAuth
This class creates the correct hostbased authentication messages as detailed in http://tools.ietf.org/html/rfc4252#section-9 and https://www.ietf.org/rfc/rfc4252.txt
Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_HOSTBASED
The standard name of the host based authentication method
|
| Constructor and Description |
|---|
HostBasedUserAuth() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addSignature(com.jcraft.jsch.Session session,
com.jcraft.jsch.Identity identity)
Create a signature from the
Session.getSessionId()
and current UserAuth.buf contents. |
protected void |
createAuthMessage(String localHostName,
String algorithm,
byte[] publicKeyBlob)
Create the authentication message to send to the server.
|
protected boolean |
handleAuthResponse(com.jcraft.jsch.Session session)
Handle the authentication response from the server.
|
protected void |
handleBanner()
Handle a SSH_MSG_USERAUTH_BANNER response from the server.
|
protected void |
handleFailure()
Handle an SSH_MSG_USERAUTH_FAILURE response from the server.
|
boolean |
start(com.jcraft.jsch.Session session) |
public static final String AUTH_HOSTBASED
public boolean start(com.jcraft.jsch.Session session)
throws Exception
start in class com.jcraft.jsch.UserAuthExceptionprotected void createAuthMessage(String localHostName, String algorithm, byte[] publicKeyBlob) throws Exception
UserAuth's internal UserAuth.buf field.
The formal of the message is defined by http://tools.ietf.org/html/rfc4252#section-9localHostName - the local host name being used for the hostbased authenticationalgorithm - the name of the key algorithmpublicKeyBlob - the public keyException - when the auth message can't be createdprotected void addSignature(com.jcraft.jsch.Session session,
com.jcraft.jsch.Identity identity)
throws Exception
Session.getSessionId()
and current UserAuth.buf contents.session - the Session to get the sessionId fromidentity - the Identity being used to authenticate to the serverException - when the signature can't be addedprotected boolean handleAuthResponse(com.jcraft.jsch.Session session)
throws Exception
session - the current Session being authenticatedException - if an error occursprotected void handleBanner()
protected void handleFailure()
throws com.jcraft.jsch.JSchPartialAuthException
JSchPartialAuthException - if this is a partial failureCopyright © 2017. All rights reserved.