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