Class CompanionPublicKey
java.lang.Object
com.hierynomus.sshj.userauth.keyprovider.CompanionPublicKey
The public key - or certificate - provided alongside a private key for the OpenSSH key file
providers (
OpenSSHKeyFile and
OpenSSHKeyV1KeyFile). It can be supplied next to the private key as a .pub /
-cert.pub file, or explicitly as a string or a stream. When none was supplied, the
providers fall back to the public key embedded in the private key file.
A parse failure is logged and otherwise ignored, again letting the provider fall back to the embedded public key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetType()booleanvoidLoad the public key - or certificate - from the given, explicitly named file.voidLoad the public key from the given stream, or do nothing when it isnull.voidLoad the public key from the given string, or do nothing when it isnull.voidloadSiblingOf(File privateKeyLocation) Load the.pub/-cert.pubfile that sits next to the given private key file, if any.
-
Constructor Details
-
CompanionPublicKey
public CompanionPublicKey()
-
-
Method Details
-
loadSiblingOf
Load the.pub/-cert.pubfile that sits next to the given private key file, if any. -
load
Load the public key - or certificate - from the given, explicitly named file. UnlikeloadSiblingOf(File), the file name is not constrained to the.pub/-cert.pubconvention, so this also covers e.g. Pritunl-Zero style-cert00.pub,-cert01.pubmulti-CA certificates, or do nothing whenpublicKeyisnull. -
load
Load the public key from the given string, or do nothing when it isnull. -
load
Load the public key from the given stream, or do nothing when it isnull. -
isPresent
public boolean isPresent() -
getPublicKey
-
getType
-