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
logFields inherited from class net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
kp, pwdf, resource, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(File location, PasswordFinder pwdf) voidinit(Reader privateKey, Reader publicKey, PasswordFinder pwdf) voidinit(String privateKey, String publicKey, PasswordFinder pwdf) private voidinitPubKey(Reader publicKey) Read and store the separate public key provided alongside the private keyMethods inherited from class net.schmizz.sshj.userauth.keyprovider.PKCS8KeyFile
readKeyPair, toStringMethods inherited from class net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
getPrivate, getType, init, init, init, init, init
-
Field Details
-
pubKey
-
-
Constructor Details
-
OpenSSHKeyFile
public OpenSSHKeyFile()
-
-
Method Details
-
getPublic
- Specified by:
getPublicin interfaceKeyProvider- Overrides:
getPublicin classBaseFileKeyProvider- Returns:
- the public key.
- Throws:
IOException- if there is an I/O error retrieving the public key
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
initPubKey
Read and store the separate public key provided alongside the private key- Parameters:
publicKey- Public key accessible through aReader- Throws:
IOException
-