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.PrivateKeygetPrivate()java.security.PublicKeygetPublic()KeyTypegetType()voidinit(java.io.File location)voidinit(java.io.File location, PasswordFinder pwdf)voidinit(java.io.Reader location)voidinit(java.io.Reader location, PasswordFinder pwdf)voidinit(java.lang.String privateKey, java.lang.String publicKey)voidinit(java.lang.String privateKey, java.lang.String publicKey, PasswordFinder pwdf)protected abstract java.security.KeyPairreadKeyPair()
-
-
-
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:
initin interfaceFileKeyProvider
-
init
public void init(java.io.Reader location, PasswordFinder pwdf)- Specified by:
initin interfaceFileKeyProvider
-
init
public void init(java.io.File location)
- Specified by:
initin interfaceFileKeyProvider
-
init
public void init(java.io.File location, PasswordFinder pwdf)- Specified by:
initin interfaceFileKeyProvider
-
init
public void init(java.lang.String privateKey, java.lang.String publicKey)- Specified by:
initin interfaceFileKeyProvider
-
init
public void init(java.lang.String privateKey, java.lang.String publicKey, PasswordFinder pwdf)- Specified by:
initin interfaceFileKeyProvider
-
getPrivate
public java.security.PrivateKey getPrivate() throws java.io.IOException- Specified by:
getPrivatein 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:
getPublicin 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:
getTypein 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
-
-