mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 23:30:55 +03:00
Merge interfaces.
This commit is contained in:
@@ -18,6 +18,7 @@ package net.schmizz.sshj.userauth.keyprovider;
|
|||||||
import net.schmizz.sshj.userauth.password.PasswordFinder;
|
import net.schmizz.sshj.userauth.password.PasswordFinder;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.Reader;
|
||||||
|
|
||||||
/** A file key provider is initialized with a location of */
|
/** A file key provider is initialized with a location of */
|
||||||
public interface FileKeyProvider
|
public interface FileKeyProvider
|
||||||
@@ -27,6 +28,10 @@ public interface FileKeyProvider
|
|||||||
|
|
||||||
void init(File location, PasswordFinder pwdf);
|
void init(File location, PasswordFinder pwdf);
|
||||||
|
|
||||||
|
void init(Reader location);
|
||||||
|
|
||||||
|
void init(Reader location, PasswordFinder pwdf);
|
||||||
|
|
||||||
void init(String privateKey, String publicKey);
|
void init(String privateKey, String publicKey);
|
||||||
|
|
||||||
void init(String privateKey, String publicKey, PasswordFinder pwdf);
|
void init(String privateKey, String publicKey, PasswordFinder pwdf);
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ public class OpenSSHKeyFile
|
|||||||
extends PKCS8KeyFile {
|
extends PKCS8KeyFile {
|
||||||
|
|
||||||
public static class Factory
|
public static class Factory
|
||||||
implements net.schmizz.sshj.common.Factory.Named<KeyProvider> {
|
implements net.schmizz.sshj.common.Factory.Named<FileKeyProvider> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KeyProvider create() {
|
public FileKeyProvider create() {
|
||||||
return new OpenSSHKeyFile();
|
return new OpenSSHKeyFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
/** Represents a PKCS8-encoded key file. This is the format used by OpenSSH and OpenSSL. */
|
/** Represents a PKCS8-encoded key file. This is the format used by OpenSSH and OpenSSL. */
|
||||||
public class PKCS8KeyFile
|
public class PKCS8KeyFile
|
||||||
implements FileKeyProvider, ReaderKeyProvider {
|
implements FileKeyProvider {
|
||||||
|
|
||||||
public static class Factory
|
public static class Factory
|
||||||
implements net.schmizz.sshj.common.Factory.Named<KeyProvider> {
|
implements net.schmizz.sshj.common.Factory.Named<FileKeyProvider> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KeyProvider create() {
|
public FileKeyProvider create() {
|
||||||
return new PKCS8KeyFile();
|
return new PKCS8KeyFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
package net.schmizz.sshj.userauth.keyprovider;
|
|
||||||
|
|
||||||
import java.io.Reader;
|
|
||||||
|
|
||||||
import net.schmizz.sshj.userauth.password.PasswordFinder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @version $Id:$
|
|
||||||
*/
|
|
||||||
public interface ReaderKeyProvider extends KeyProvider {
|
|
||||||
|
|
||||||
void init(Reader location);
|
|
||||||
|
|
||||||
void init(Reader location, PasswordFinder pwdf);
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user