Class BaseFileKeyProvider
- java.lang.Object
-
- net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
-
- All Implemented Interfaces:
FileKeyProvider
,KeyProvider
- Direct Known Subclasses:
OpenSSHKeyV1KeyFile
,PKCS8KeyFile
,PuTTYKeyFile
public abstract class BaseFileKeyProvider extends java.lang.Object implements FileKeyProvider
-
-
Constructor Summary
Constructors Constructor Description BaseFileKeyProvider()
-
Method Summary
Modifier and Type Method Description java.security.PrivateKey
getPrivate()
java.security.PublicKey
getPublic()
KeyType
getType()
void
init(java.io.File location)
void
init(java.io.File location, PasswordFinder pwdf)
void
init(java.io.Reader location)
void
init(java.io.Reader privateKey, java.io.Reader publicKey)
void
init(java.io.Reader privateKey, java.io.Reader publicKey, PasswordFinder pwdf)
void
init(java.io.Reader location, PasswordFinder pwdf)
void
init(java.lang.String privateKey, java.lang.String publicKey)
void
init(java.lang.String privateKey, java.lang.String publicKey, PasswordFinder pwdf)
protected abstract java.security.KeyPair
readKeyPair()
-
-
-
Field Detail
-
resource
protected Resource<?> resource
-
pwdf
protected PasswordFinder pwdf
-
kp
protected java.security.KeyPair kp
-
type
protected KeyType type
-
-
Method Detail
-
init
public void init(java.io.Reader location)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.io.Reader location, PasswordFinder pwdf)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.io.Reader privateKey, java.io.Reader publicKey)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.io.Reader privateKey, java.io.Reader publicKey, PasswordFinder pwdf)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.io.File location)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.io.File location, PasswordFinder pwdf)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.lang.String privateKey, java.lang.String publicKey)
- Specified by:
init
in interfaceFileKeyProvider
-
init
public void init(java.lang.String privateKey, java.lang.String publicKey, PasswordFinder pwdf)
- Specified by:
init
in interfaceFileKeyProvider
-
getPrivate
public java.security.PrivateKey getPrivate() throws java.io.IOException
- Specified by:
getPrivate
in interfaceKeyProvider
- Returns:
- the private key.
- Throws:
java.io.IOException
- if there is an I/O error retrieving the private key
-
getPublic
public java.security.PublicKey getPublic() throws java.io.IOException
- Specified by:
getPublic
in interfaceKeyProvider
- Returns:
- the public key.
- Throws:
java.io.IOException
- if there is an I/O error retrieving the public key
-
getType
public KeyType getType() throws java.io.IOException
- Specified by:
getType
in interfaceKeyProvider
- Returns:
- the
KeyType
. - Throws:
java.io.IOException
- if there is an I/O error retrieving the key type
-
readKeyPair
protected abstract java.security.KeyPair readKeyPair() throws java.io.IOException
- Throws:
java.io.IOException
-
-