public class Sha256PasswordPlugin extends java.lang.Object implements AuthenticationPlugin<NativePacketPayload>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
password |
static java.lang.String |
PLUGIN_NAME |
protected Protocol<NativePacketPayload> |
protocol |
protected boolean |
publicKeyRequested |
protected java.lang.String |
publicKeyString |
protected java.lang.String |
seed |
protected RuntimeProperty<java.lang.String> |
serverRSAPublicKeyFile |
protected MysqlCallbackHandler |
usernameCallbackHandler |
Constructor and Description |
---|
Sha256PasswordPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.
|
protected byte[] |
encryptPassword() |
protected byte[] |
encryptPassword(java.lang.String transformation) |
java.lang.String |
getProtocolPluginName()
Returns the client-side name that the MySQL server uses on the wire for this plugin.
|
void |
init(Protocol<NativePacketPayload> prot,
MysqlCallbackHandler cbh)
Initializes this plugin with a direct Protocol reference and a generic
MysqlCallbackHandler that can be used to pass over information back to the
authentication provider. |
boolean |
isReusable() |
boolean |
nextAuthenticationStep(NativePacketPayload fromServer,
java.util.List<NativePacketPayload> toServer)
Process authentication handshake data from server and optionally produce data to be sent back to the server.
|
protected static java.lang.String |
readRSAKey(java.lang.String pkPath,
PropertySet propertySet,
ExceptionInterceptor exceptionInterceptor) |
boolean |
requiresConfidentiality()
Does this plugin require the connection itself to be confidential (i.e.
|
void |
setAuthenticationParameters(java.lang.String user,
java.lang.String password)
This method called from Connector/J before first nextAuthenticationStep call.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
init, reset, setSourceOfAuthData
public static java.lang.String PLUGIN_NAME
protected Protocol<NativePacketPayload> protocol
protected MysqlCallbackHandler usernameCallbackHandler
protected java.lang.String password
protected java.lang.String seed
protected boolean publicKeyRequested
protected java.lang.String publicKeyString
protected RuntimeProperty<java.lang.String> serverRSAPublicKeyFile
public void init(Protocol<NativePacketPayload> prot, MysqlCallbackHandler cbh)
AuthenticationPlugin
MysqlCallbackHandler
that can be used to pass over information back to the
authentication provider.
For example an authentication plugin may accept null
usernames and use that information to obtain them from some external source, such as
the system login.init
in interface AuthenticationPlugin<NativePacketPayload>
prot
- the protocol instancecbh
- a callback handler to provide additional information to the authentication providerpublic void destroy()
AuthenticationPlugin
destroy
in interface AuthenticationPlugin<NativePacketPayload>
public java.lang.String getProtocolPluginName()
AuthenticationPlugin
getProtocolPluginName
in interface AuthenticationPlugin<NativePacketPayload>
public boolean requiresConfidentiality()
AuthenticationPlugin
requiresConfidentiality
in interface AuthenticationPlugin<NativePacketPayload>
public boolean isReusable()
isReusable
in interface AuthenticationPlugin<NativePacketPayload>
public void setAuthenticationParameters(java.lang.String user, java.lang.String password)
AuthenticationPlugin
setAuthenticationParameters
in interface AuthenticationPlugin<NativePacketPayload>
user
- user namepassword
- user passwordpublic boolean nextAuthenticationStep(NativePacketPayload fromServer, java.util.List<NativePacketPayload> toServer)
AuthenticationPlugin
nextAuthenticationStep
in interface AuthenticationPlugin<NativePacketPayload>
fromServer
- a buffer containing handshake data payload from
server (can be empty).toServer
- list of buffers with data to be sent to the server
(the list can be empty, but buffers in the list
should contain data).protected byte[] encryptPassword()
protected byte[] encryptPassword(java.lang.String transformation)
protected static java.lang.String readRSAKey(java.lang.String pkPath, PropertySet propertySet, ExceptionInterceptor exceptionInterceptor)