public abstract class SshContextFactory extends Object implements ProtocolContextFactory<SshContext>
| Constructor and Description |
|---|
SshContextFactory() |
SshContextFactory(ServerComponentManager componentManager,
com.maverick.ssh.components.SshKeyPair... keys) |
SshContextFactory(com.maverick.ssh.components.SshKeyPair... keys) |
| Modifier and Type | Method and Description |
|---|---|
void |
configureAcceptorCodec(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext) |
void |
configureAcceptorHandler(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext) |
void |
configureAcceptorPreCodec(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext) |
void |
configureAcceptorPreHandler(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext) |
abstract SshContext |
createContext(SocketAddress remoteAddress,
SocketAddress localAddress) |
protected SshContext |
createDefaultContext() |
static com.maverick.ssh.components.SshKeyPair |
GenerateKeyFiles(File keyFilename,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat)
Generate a public and private key pair, save them to keyFilename and keyFilename.pub, return the key pair
|
void |
loadHostKey(InputStream in,
String type,
int bitlength) |
void |
loadHostKey(InputStream in,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat,
String passPhrase) |
void |
loadHostKey(InputStream in,
String type,
int bitlength,
String passPhrase) |
com.maverick.ssh.components.SshKeyPair |
loadKey(File key,
String passphrase) |
com.maverick.ssh.components.SshKeyPair |
loadKey(InputStream in,
String passphrase) |
void |
loadOrGenerateHostKey(File key,
String type,
int bitlength)
Load a host key from file, if the file does not exist then generate the
key.
|
void |
loadOrGenerateHostKey(File key,
String type,
int bitlength,
int privateKeyFormat,
int publicKeyFormat,
String passPhrase)
Load a host key from file, if the file does not exist then generate the
key.
|
void |
loadOrGenerateHostKey(File key,
String type,
int bitlength,
String passPhrase) |
public SshContextFactory()
throws IOException,
com.maverick.ssh.SshException
IOExceptioncom.maverick.ssh.SshExceptionpublic SshContextFactory(com.maverick.ssh.components.SshKeyPair... keys)
throws IOException,
com.maverick.ssh.SshException
IOExceptioncom.maverick.ssh.SshExceptionpublic SshContextFactory(ServerComponentManager componentManager, com.maverick.ssh.components.SshKeyPair... keys) throws IOException, com.maverick.ssh.SshException
IOExceptioncom.maverick.ssh.SshExceptionpublic void configureAcceptorPreCodec(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext)
configureAcceptorPreCodec in interface ProtocolContextFactory<SshContext>public final void configureAcceptorCodec(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext)
configureAcceptorCodec in interface ProtocolContextFactory<SshContext>public void configureAcceptorPreHandler(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext)
configureAcceptorPreHandler in interface ProtocolContextFactory<SshContext>public final void configureAcceptorHandler(org.apache.mina.core.service.IoAcceptor acceptor,
DaemonContext<SshContext> daemonContext)
configureAcceptorHandler in interface ProtocolContextFactory<SshContext>public abstract SshContext createContext(SocketAddress remoteAddress, SocketAddress localAddress) throws IOException
createContext in interface ProtocolContextFactory<SshContext>IOExceptionprotected SshContext createDefaultContext() throws IOException
IOExceptionpublic void loadOrGenerateHostKey(File key, String type, int bitlength) throws IOException, com.sshtools.publickey.InvalidPassphraseException, com.maverick.ssh.SshException
key - the key filetype - the type of key; acceptable values are SshKeyPairGenerator.SSH2_RSA
or SshKeyPairGenerator.SSH2_DSAbitlength - the bit length of the keyIOExceptioncom.maverick.ssh.SshExceptioncom.sshtools.publickey.InvalidPassphraseExceptionpublic void loadOrGenerateHostKey(File key, String type, int bitlength, String passPhrase) throws IOException, com.sshtools.publickey.InvalidPassphraseException, com.maverick.ssh.SshException
IOExceptioncom.sshtools.publickey.InvalidPassphraseExceptioncom.maverick.ssh.SshExceptionpublic void loadHostKey(InputStream in, String type, int bitlength) throws IOException, com.sshtools.publickey.InvalidPassphraseException, com.maverick.ssh.SshException
IOExceptioncom.sshtools.publickey.InvalidPassphraseExceptioncom.maverick.ssh.SshExceptionpublic void loadHostKey(InputStream in, String type, int bitlength, String passPhrase) throws IOException, com.sshtools.publickey.InvalidPassphraseException, com.maverick.ssh.SshException
IOExceptioncom.sshtools.publickey.InvalidPassphraseExceptioncom.maverick.ssh.SshExceptionpublic void loadOrGenerateHostKey(File key, String type, int bitlength, int privateKeyFormat, int publicKeyFormat, String passPhrase) throws IOException, com.sshtools.publickey.InvalidPassphraseException, com.maverick.ssh.SshException
key - the key filetype - the type of key; acceptable values are SshKeyPairGenerator.SSH2_RSA
or SshKeyPairGenerator.SSH2_DSAbitlength - the bit length of the keyprivateKeyFormat - the format of the private key, SshPrivateKeyFileFactorypublicKeyFormat - the format of the public key, {see com.sshtools.publickey.SshPublicKeyFileFactory}passPhrase - the passPhrase of an existing host keyIOExceptioncom.maverick.ssh.SshExceptioncom.sshtools.publickey.InvalidPassphraseExceptionpublic void loadHostKey(InputStream in, String type, int bitlength, int privateKeyFormat, int publicKeyFormat, String passPhrase) throws IOException, com.sshtools.publickey.InvalidPassphraseException, com.maverick.ssh.SshException
IOExceptioncom.sshtools.publickey.InvalidPassphraseExceptioncom.maverick.ssh.SshExceptionpublic com.maverick.ssh.components.SshKeyPair loadKey(File key, String passphrase) throws IOException, com.sshtools.publickey.InvalidPassphraseException
IOExceptioncom.sshtools.publickey.InvalidPassphraseExceptionpublic com.maverick.ssh.components.SshKeyPair loadKey(InputStream in, String passphrase) throws IOException, com.sshtools.publickey.InvalidPassphraseException
IOExceptioncom.sshtools.publickey.InvalidPassphraseExceptionpublic static com.maverick.ssh.components.SshKeyPair GenerateKeyFiles(File keyFilename, String type, int bitlength, int privateKeyFormat, int publicKeyFormat) throws IOException, com.maverick.ssh.SshException
keyFilename - type - bitlength - privateKeyFormat - publicKeyFormat - IOExceptioncom.maverick.ssh.SshExceptionCopyright © 2012. All Rights Reserved.