public class X509HostKeyVerification extends Object implements HostKeyVerification
HostKeyVerification implementation that will validate an X509 public key.| Constructor and Description |
|---|
X509HostKeyVerification(boolean enableRevocation)
This creates a verification instance that will check the validation of a certificate
against the Java runtime's trusted CA certs keystore.
|
X509HostKeyVerification(Set<TrustAnchor> trustAnchors,
boolean enableRevocation)
This creates a verification instance against a specific set of TrustAnchors
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
verifyHost(String host,
SshPublicKey pk)
Verify that the public key is acceptable for the host.
|
public X509HostKeyVerification(boolean enableRevocation)
throws IOException,
KeyStoreException,
NoSuchAlgorithmException,
CertificateException,
InvalidAlgorithmParameterException
enableRevocation - IOExceptionKeyStoreExceptionNoSuchAlgorithmExceptionCertificateExceptionInvalidAlgorithmParameterExceptionpublic X509HostKeyVerification(Set<TrustAnchor> trustAnchors, boolean enableRevocation) throws InvalidAlgorithmParameterException
trustAnchors - enableRevocation - InvalidAlgorithmParameterExceptionpublic boolean verifyHost(String host, SshPublicKey pk) throws SshException
HostKeyVerificationverifyHost in interface HostKeyVerificationhost - the name of the connected hostpk - the public key supplied by the hosttrue if the host key is acceptable otherwise
falseSshExceptionCopyright © 2025. All rights reserved.