Class OpenSSHKeyV1KeyFile
java.lang.Object
net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
com.hierynomus.sshj.userauth.keyprovider.OpenSSHKeyV1KeyFile
- All Implemented Interfaces:
FileKeyProvider,KeyProvider
Reads a key file in the new OpenSSH format.
The format is described in the following document: Key Protocol
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final org.slf4j.Loggerstatic final StringFields inherited from class net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
kp, pwdf, resource, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetType()voidinit(File privateKey, File publicKey, PasswordFinder pwdf) voidinit(File location, PasswordFinder pwdf) voidinit(Reader privateKey, Reader publicKey, PasswordFinder pwdf) voidinit(String privateKey, String publicKey, PasswordFinder pwdf) protected KeyPairvoidsetSecurityKeySigner(SecurityKeySigner securityKeySigner) Attach the bridge to the hardware authenticator used to sign with a FIDO/U2F security key (sk-ecdsa-sha2-nistp256@openssh.com/sk-ssh-ed25519@openssh.com).Methods inherited from class net.schmizz.sshj.userauth.keyprovider.BaseFileKeyProvider
getPrivate, init, init, init, init, init, init
-
Field Details
-
OPENSSH_PRIVATE_KEY
- See Also:
-
BCRYPT
- See Also:
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
OpenSSHKeyV1KeyFile
public OpenSSHKeyV1KeyFile()
-
-
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
-
getType
- Specified by:
getTypein interfaceKeyProvider- Overrides:
getTypein classBaseFileKeyProvider- Returns:
- the
KeyType. - Throws:
IOException- if there is an I/O error retrieving the key type
-
setSecurityKeySigner
Attach the bridge to the hardware authenticator used to sign with a FIDO/U2F security key (sk-ecdsa-sha2-nistp256@openssh.com/sk-ssh-ed25519@openssh.com). Without it such a key can be read but not used to sign. Not needed when authenticating via an SSH agent.- Parameters:
securityKeySigner- the signer, ornullto clear it
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
init
- Specified by:
initin interfaceFileKeyProvider- Overrides:
initin classBaseFileKeyProvider
-
readKeyPair
- Specified by:
readKeyPairin classBaseFileKeyProvider- Throws:
IOException
-