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
- IOException
KeyStoreException
NoSuchAlgorithmException
CertificateException
InvalidAlgorithmParameterException
public X509HostKeyVerification(Set<TrustAnchor> trustAnchors, boolean enableRevocation) throws InvalidAlgorithmParameterException
trustAnchors
- enableRevocation
- InvalidAlgorithmParameterException
public boolean verifyHost(String host, SshPublicKey pk) throws SshException
HostKeyVerification
verifyHost
in interface HostKeyVerification
host
- the name of the connected hostpk
- the public key supplied by the hosttrue
if the host key is acceptable otherwise
false
SshException
Copyright © 2024. All rights reserved.