| Method from com.sshtools.common.automate.AuthorizedKeys Detail: |
public void addKey(String username,
SshPublicKey key) {
if (!containsKey(key)) {
keys.put(key, username);
}
}
|
public boolean containsKey(SshPublicKey key) {
return keys.containsValue(key);
}
|
public static byte[] create(AuthorizedKeys keys,
String serverId,
String hostname,
AuthorizedKeysFileSaver saver) throws IOException, RemoteIdentificationException, InvalidSshKeyException {
AuthorizedKeysFormat format = RemoteIdentificationFactory.getInstance(serverId,
hostname).getAuthorizedKeysFormat();
if (format.requiresKeyFiles()) {
return format.format(keys, saver);
} else {
return format.format(keys);
}
}
|
public Map getAuthorizedKeys() {
return keys;
}
|
public static AuthorizedKeys parse(byte[] formatted,
String serverId,
String hostname,
AuthorizedKeysFileLoader loader) throws IOException, RemoteIdentificationException, InvalidSshKeyException {
AuthorizedKeysFormat format = RemoteIdentificationFactory.getInstance(serverId,
hostname).getAuthorizedKeysFormat();
if (format.requiresKeyFiles()) {
return format.unformat(formatted, loader);
} else {
return format.unformat(formatted);
}
}
|
public void removeKey(SshPublicKey key) {
keys.remove(key);
}
|