public class CachingSha2PasswordPlugin extends Object implements AuthenticationPlugin
| Constructor and Description |
|---|
CachingSha2PasswordPlugin() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
encrypt(PublicKey publicKey,
String password,
byte[] seed)
Encode password with seed and public key.
|
static PublicKey |
generatePublicKey(byte[] publicKeyBytes)
Read public pem key from String.
|
void |
initialize(String authenticationData,
byte[] seed,
Configuration conf)
Initialized data.
|
com.singlestore.jdbc.client.ReadableByteBuf |
process(PacketWriter out,
PacketReader in,
Context context)
Process native password plugin authentication.
|
static PublicKey |
readPublicKeyFromFile(String serverRsaPublicKeyFile)
Read public Key from file.
|
static byte[] |
sha256encryptPassword(CharSequence password,
byte[] seed)
Send a SHA-2 encrypted password.
|
String |
type()
Authentication plugin type.
|
public static final String TYPE
public static byte[] sha256encryptPassword(CharSequence password, byte[] seed)
password - passwordseed - seedpublic String type()
AuthenticationPlugintype in interface AuthenticationPluginpublic void initialize(String authenticationData, byte[] seed, Configuration conf)
initialize in interface AuthenticationPluginauthenticationData - authentication data (password/token)seed - server provided seedconf - Connection string optionspublic com.singlestore.jdbc.client.ReadableByteBuf process(PacketWriter out, PacketReader in, Context context) throws IOException, SQLException
process in interface AuthenticationPluginout - out streamin - in streamcontext - connection contextIOException - if socket errorSQLException - if plugin exceptionpublic static PublicKey readPublicKeyFromFile(String serverRsaPublicKeyFile) throws SQLException
serverRsaPublicKeyFile - RSA public key fileSQLException - if cannot read file or file content is not a public key.public static PublicKey generatePublicKey(byte[] publicKeyBytes) throws SQLException
publicKeyBytes - public key bytes valueSQLException - if key cannot be parsedpublic static byte[] encrypt(PublicKey publicKey, String password, byte[] seed) throws SQLException
publicKey - public keypassword - passwordseed - seedSQLException - if cannot encode passwordCopyright © 2021 SingleStore. All rights reserved.