public class HostBased extends Object implements Authentication, JSchBasedAuthentication
Authentication see http://tools.ietf.org/html/rfc4252#section-9
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 authentication method name for host based authentication.
|
static byte[] |
NO_PASS_PHRASE
The empty pass phrase to use if none is required.
|
static String |
SSH_PREFERRED_AUTHENTICATIONS
The SSH configuration name for the preferred authentication methods list.
|
| Constructor and Description |
|---|
HostBased(String privateKeyFileName)
Create a
HostBased using the specified
private key. |
HostBased(String privateKey,
byte[] passphrase)
Create a
HostBased using the specified
private key and pass phrase. |
HostBased(String privateKey,
String passphrase)
Create a
HostBased using the specified
private key and pass phrase. |
HostBased(String privateKey,
String publicKey,
byte[] passphrase)
Create a
HostBased using the specified
private key and pass phrase. |
HostBased(String privateKey,
String publicKey,
String passphrase)
Create a
HostBased using the specified
private key and pass phrase. |
| Modifier and Type | Method and Description |
|---|---|
HostBased |
addIdentity(String privateKey)
Add an alternative identity that may be used to attempt authentication.
|
HostBased |
addIdentity(String privateKey,
byte[] passphrase)
Add an alternative identity that may be used to attempt authentication.
|
HostBased |
addIdentity(String privateKey,
String passphrase)
Add an alternative identity that may be used to attempt authentication.
|
HostBased |
addIdentity(String privateKey,
String publicKey,
byte[] passphrase)
Add an alternative identity that may be used to attempt authentication.
|
HostBased |
addIdentity(String privateKey,
String publicKey,
String passphrase)
Add an alternative identity that may be used to attempt authentication.
|
void |
configureFramework(com.jcraft.jsch.JSch jsch)
|
void |
configureSession(com.jcraft.jsch.Session session)
|
static byte[] |
stringToBytes(String s)
Convert the specified String to a UTF-8 byte array.
|
public static final byte[] NO_PASS_PHRASE
public static final String SSH_PREFERRED_AUTHENTICATIONS
public static final String AUTH_HOSTBASED
public HostBased(String privateKeyFileName)
HostBased using the specified
private key.privateKeyFileName - the private key to use to authenticatepublic HostBased(String privateKey, byte[] passphrase)
HostBased using the specified
private key and pass phrase.privateKey - the private key to use to authenticatepassphrase - he optional pass phrase for the private keypublic HostBased(String privateKey, String passphrase)
HostBased using the specified
private key and pass phrase.privateKey - the private key to use to authenticatepassphrase - he optional pass phrase for the private keypublic HostBased(String privateKey, String publicKey, byte[] passphrase)
HostBased using the specified
private key and pass phrase.privateKey - the private key to use to authenticatepublicKey - the optional public key to use to authenticatepassphrase - he optional pass phrase for the private keypublic HostBased(String privateKey, String publicKey, String passphrase)
HostBased using the specified
private key and pass phrase.privateKey - the private key to use to authenticatepublicKey - the optional public key to use to authenticatepassphrase - he optional pass phrase for the private keypublic HostBased addIdentity(String privateKey)
privateKey - the private key to use to authenticateHostBasedpublic HostBased addIdentity(String privateKey, String passphrase)
privateKey - the private key to use to authenticatepassphrase - he optional pass phrase for the private keyHostBasedpublic HostBased addIdentity(String privateKey, byte[] passphrase)
privateKey - the private key to use to authenticatepassphrase - he optional pass phrase for the private keyHostBasedpublic HostBased addIdentity(String privateKey, String publicKey, String passphrase)
privateKey - the private key to use to authenticatepublicKey - the optional public key to use to authenticatepassphrase - he optional pass phrase for the private keyHostBasedpublic HostBased addIdentity(String privateKey, String publicKey, byte[] passphrase)
privateKey - the private key to use to authenticatepublicKey - the optional public key to use to authenticatepassphrase - he optional pass phrase for the private keyHostBasedpublic void configureFramework(com.jcraft.jsch.JSch jsch)
JSchBasedAuthenticationconfigureFramework in interface JSchBasedAuthenticationjsch - the JSch framework to configurepublic void configureSession(com.jcraft.jsch.Session session)
JSchBasedAuthenticationconfigureSession in interface JSchBasedAuthenticationsession - the Session to configurepublic static byte[] stringToBytes(String s)
s - the string to convertCopyright © 2017. All rights reserved.