public class NativePasswordPlugin extends Object implements AuthenticationPlugin
| Constructor and Description |
|---|
NativePasswordPlugin() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
encryptPassword(CharSequence password,
byte[] seed)
Encrypts a password.
|
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.
|
String |
type()
Authentication plugin type.
|
public static final String TYPE
public static byte[] encryptPassword(CharSequence password, byte[] seed)
protocol for authentication is like this: 1. Server sends a random array of bytes (the seed) 2. client makes a sha1 digest of the password 3. client hashes the output of 2 4. client digests the seed 5. client updates the digest with the output from 3 6. an xor of the output of 5 and 2 is sent to server 7. server does the same thing and verifies that the scrambled passwords match
password - the password to encryptseed - the seed to usepublic 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
process in interface AuthenticationPluginout - out streamin - in streamcontext - connection contextIOException - if socket errorCopyright © 2023 SingleStore. All rights reserved.