Class OpenSSHKeyFile
java.lang.Object
net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
net.schmizz.sshj.userauth.keyprovider.OpenSSHKeyFile
- All Implemented Interfaces:
FileKeyProvider
,KeyProvider
Represents an OpenSSH identity that consists of a PKCS8-encoded private key file and an unencrypted public key file
of the same name with the
".pub"
extension. This allows to delay requesting of the passphrase until the
private key is requested.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
log, privateKeyInfoKeyPairConverter
Fields inherited from class net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
kp, pwdf, resource, type
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
readKeyPair, toString
Methods inherited from class net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
getPrivate, getType, init, init, init, init
-
Field Details
-
pubKey
-
-
Constructor Details
-
OpenSSHKeyFile
public OpenSSHKeyFile()
-
-
Method Details
-
getPublic
- Specified by:
getPublic
in interfaceKeyProvider
- Overrides:
getPublic
in classBaseFileKeyProvider
- Returns:
- the public key.
- Throws:
IOException
- if there is an I/O error retrieving the public key
-
init
- Specified by:
init
in interfaceFileKeyProvider
- Overrides:
init
in classBaseFileKeyProvider
-
init
- Specified by:
init
in interfaceFileKeyProvider
- Overrides:
init
in classBaseFileKeyProvider
-
initPubKey
Read and store the separate public key provided alongside the private key- Parameters:
publicKey
- Public key accessible through aReader
- Throws:
IOException
-