*/
public byte[] format(AuthorizedKeys keys)
throws IOException, InvalidSshKeyException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
SshPublicKeyFile pubfile;
OpenSSHPublicKeyFormat openssh = new OpenSSHPublicKeyFormat();
Map.Entry entry;
for (Iterator it = keys.getAuthorizedKeys().entrySet().iterator();
(it != null) && it.hasNext();) {
entry = (Map.Entry) it.next();
openssh.setComment((String) entry.getValue());
pubfile = SshPublicKeyFile.create((SshPublicKey) entry.getKey(),
openssh);
out.write(pubfile.toString().getBytes("US-ASCII"));
out.write('\n');
}