Search in sources :

Example 1 with SshHostKey

use of com.google.gerrit.common.data.SshHostKey in project gerrit by GerritCodeReview.

the class SystemInfoServiceImpl method daemonHostKeys.

@Override
public void daemonHostKeys(final AsyncCallback<List<SshHostKey>> callback) {
    final ArrayList<SshHostKey> r = new ArrayList<>(hostKeys.size());
    for (final HostKey hk : hostKeys) {
        String host = hk.getHost();
        if (host.startsWith("*:")) {
            final String port = host.substring(2);
            host = "[" + httpRequest.get().getServerName() + "]:" + port;
        }
        final String fp = hk.getFingerPrint(JSCH);
        r.add(new SshHostKey(host, hk.getType() + " " + hk.getKey(), fp));
    }
    callback.onSuccess(r);
}
Also used : HostKey(com.jcraft.jsch.HostKey) SshHostKey(com.google.gerrit.common.data.SshHostKey) SshHostKey(com.google.gerrit.common.data.SshHostKey) ArrayList(java.util.ArrayList)

Aggregations

SshHostKey (com.google.gerrit.common.data.SshHostKey)1 HostKey (com.jcraft.jsch.HostKey)1 ArrayList (java.util.ArrayList)1