public class CachingSha2PasswordPlugin extends java.lang.Object implements AuthenticationPlugin
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
authenticationData |
private Options |
options |
private byte[] |
seed |
static java.lang.String |
TYPE |
| Constructor and Description |
|---|
CachingSha2PasswordPlugin() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(java.lang.String authenticationData,
byte[] seed,
Options options)
Initialized data.
|
java.lang.String |
name()
Authentication plugin name.
|
Buffer |
process(PacketOutputStream out,
PacketInputStream in,
java.util.concurrent.atomic.AtomicInteger sequence)
Process native password plugin authentication.
|
static byte[] |
sha256encryptPassword(java.lang.String password,
byte[] seed,
java.lang.String passwordCharacterEncoding)
Send a SHA-2 encrypted password.
|
java.lang.String |
type()
Authentication plugin type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmustUseSslpublic static final java.lang.String TYPE
private java.lang.String authenticationData
private byte[] seed
private Options options
public static byte[] sha256encryptPassword(java.lang.String password,
byte[] seed,
java.lang.String passwordCharacterEncoding)
throws java.security.NoSuchAlgorithmException,
java.io.UnsupportedEncodingException
password - passwordseed - seedpasswordCharacterEncoding - option if not using default byte encodingjava.security.NoSuchAlgorithmException - if SHA-256 algorithm is unknownjava.io.UnsupportedEncodingException - if SHA-256 algorithm is unknownpublic java.lang.String name()
AuthenticationPluginname in interface AuthenticationPluginpublic java.lang.String type()
AuthenticationPlugintype in interface AuthenticationPluginpublic void initialize(java.lang.String authenticationData,
byte[] seed,
Options options)
initialize in interface AuthenticationPluginauthenticationData - authentication data (password/token)seed - server provided seedoptions - Connection string optionspublic Buffer process(PacketOutputStream out, PacketInputStream in, java.util.concurrent.atomic.AtomicInteger sequence) throws java.io.IOException, java.sql.SQLException
process in interface AuthenticationPluginout - out streamin - in streamsequence - packet sequencejava.io.IOException - if socket errorjava.sql.SQLException - if plugin exception