public class SshUtil extends Object
Constructor and Description |
---|
SshUtil() |
Modifier and Type | Method and Description |
---|---|
static IdentifiedUser |
createUser(SshSession sd,
IdentifiedUser.GenericFactory userFactory,
com.google.gerrit.reviewdb.client.Account.Id account) |
static PublicKey |
parse(com.google.gerrit.reviewdb.client.AccountSshKey key)
Parse a public key into its Java type.
|
static boolean |
success(String username,
org.apache.sshd.server.session.ServerSession session,
SshScope sshScope,
com.google.gerrit.sshd.SshLog sshLog,
SshSession sd,
CurrentUser user) |
static String |
toOpenSshPublicKey(String keyStr)
Convert an RFC 4716 style key to an OpenSSH style key.
|
public static PublicKey parse(com.google.gerrit.reviewdb.client.AccountSshKey key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchProviderException
key
- the account key to parse.InvalidKeySpecException
- the key supplied is not a valid SSH key.NoSuchAlgorithmException
- the JVM is missing the key algorithm.NoSuchProviderException
- the JVM is missing the provider.public static String toOpenSshPublicKey(String keyStr)
keyStr
- the key string to convert.keyStr
if conversion failed; otherwise the converted
key, in OpenSSH key format.public static boolean success(String username, org.apache.sshd.server.session.ServerSession session, SshScope sshScope, com.google.gerrit.sshd.SshLog sshLog, SshSession sd, CurrentUser user)
public static IdentifiedUser createUser(SshSession sd, IdentifiedUser.GenericFactory userFactory, com.google.gerrit.reviewdb.client.Account.Id account)