public class NativePasswordPlugin extends Object implements AuthenticationPlugin
| Constructor and Description |
|---|
NativePasswordPlugin(String authenticationData,
byte[] seed)
Initialized data.
|
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
encryptPassword(CharSequence password,
byte[] seed)
Encrypts a password.
|
com.singlestore.jdbc.client.ReadableByteBuf |
process(Writer out,
Reader in,
com.singlestore.jdbc.client.Context context)
Process native password plugin authentication.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrequireSslpublic NativePasswordPlugin(String authenticationData, byte[] seed)
authenticationData - authentication data (password/token)seed - server provided seedpublic 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 com.singlestore.jdbc.client.ReadableByteBuf process(Writer out, Reader in, com.singlestore.jdbc.client.Context context) throws IOException
process in interface AuthenticationPluginout - out streamin - in streamcontext - connection contextIOException - if socket errorCopyright © 2025 SingleStore. All rights reserved.