Merge interfaces.

This commit is contained in:
David Kocher
2014-05-07 10:37:14 +02:00
parent 896b0ea288
commit 97535bbcae
4 changed files with 10 additions and 20 deletions

View File

@@ -18,6 +18,7 @@ package net.schmizz.sshj.userauth.keyprovider;
import net.schmizz.sshj.userauth.password.PasswordFinder;
import java.io.File;
import java.io.Reader;
/** A file key provider is initialized with a location of */
public interface FileKeyProvider
@@ -27,6 +28,10 @@ public interface FileKeyProvider
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, PasswordFinder pwdf);

View File

@@ -39,10 +39,10 @@ public class OpenSSHKeyFile
extends PKCS8KeyFile {
public static class Factory
implements net.schmizz.sshj.common.Factory.Named<KeyProvider> {
implements net.schmizz.sshj.common.Factory.Named<FileKeyProvider> {
@Override
public KeyProvider create() {
public FileKeyProvider create() {
return new OpenSSHKeyFile();
}

View File

@@ -43,13 +43,13 @@ import org.slf4j.LoggerFactory;
/** Represents a PKCS8-encoded key file. This is the format used by OpenSSH and OpenSSL. */
public class PKCS8KeyFile
implements FileKeyProvider, ReaderKeyProvider {
implements FileKeyProvider {
public static class Factory
implements net.schmizz.sshj.common.Factory.Named<KeyProvider> {
implements net.schmizz.sshj.common.Factory.Named<FileKeyProvider> {
@Override
public KeyProvider create() {
public FileKeyProvider create() {
return new PKCS8KeyFile();
}

View File

@@ -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);
}