类 CachingSha2PasswordPlugin
- java.lang.Object
-
- com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin
-
- com.mysql.cj.protocol.a.authentication.CachingSha2PasswordPlugin
-
- 所有已实现的接口:
AuthenticationPlugin<NativePacketPayload>
public class CachingSha2PasswordPlugin extends Sha256PasswordPlugin
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classCachingSha2PasswordPlugin.AuthStage
-
字段概要
字段 修饰符和类型 字段 说明 static StringPLUGIN_NAME-
从类继承的字段 com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin
password, protocol, publicKeyRequested, publicKeyString, seed, serverRSAPublicKeyFile
-
-
构造器概要
构造器 构造器 说明 CachingSha2PasswordPlugin()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddestroy()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()StringgetProtocolPluginName()Returns the name that the MySQL server uses on the wire for this pluginvoidinit(Protocol<NativePacketPayload> prot)We need direct Protocol reference because it isn't available from Connection before authentication complete.booleannextAuthenticationStep(NativePacketPayload fromServer, List<NativePacketPayload> toServer)Process authentication handshake data from server and optionally produce data to be sent back to the server.voidreset()Resets the authentication steps sequence.-
从类继承的方法 com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin
encryptPassword, isReusable, readRSAKey, requiresConfidentiality, setAuthenticationParameters
-
-
-
-
字段详细资料
-
PLUGIN_NAME
public static String PLUGIN_NAME
-
-
方法详细资料
-
init
public void init(Protocol<NativePacketPayload> prot)
从接口复制的说明:AuthenticationPluginWe need direct Protocol reference because it isn't available from Connection before authentication complete.- 指定者:
init在接口中AuthenticationPlugin<NativePacketPayload>- 覆盖:
init在类中Sha256PasswordPlugin- 参数:
prot- protocol instance
-
reset
public void reset()
从接口复制的说明:AuthenticationPluginResets the authentication steps sequence.
-
destroy
public void destroy()
从接口复制的说明:AuthenticationPluginCalled by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.- 指定者:
destroy在接口中AuthenticationPlugin<NativePacketPayload>- 覆盖:
destroy在类中Sha256PasswordPlugin
-
getProtocolPluginName
public String getProtocolPluginName()
从接口复制的说明:AuthenticationPluginReturns the name that the MySQL server uses on the wire for this plugin- 指定者:
getProtocolPluginName在接口中AuthenticationPlugin<NativePacketPayload>- 覆盖:
getProtocolPluginName在类中Sha256PasswordPlugin- 返回:
- plugin name
-
nextAuthenticationStep
public boolean nextAuthenticationStep(NativePacketPayload fromServer, List<NativePacketPayload> toServer)
从接口复制的说明:AuthenticationPluginProcess authentication handshake data from server and optionally produce data to be sent back to the server. The driver will keep calling this method until either an Exception is thrown (authentication failure, please use appropriate SQLStates) or the method returns false or driver receives an OK packet from the server which indicates that the connection has been already approved. If, on return from this method, toServer is a non-empty list of buffers, then these buffers should be sent to the server in order and without any reads in between them. If toServer is an empty list, no data should be sent to server. If method returns true, it means that this plugin does not need any more data from the server to conclude the handshake and this method should not be called again. (Note that server can send an Auth Method Switch request and then another handshake will start, possibly using a different plugin.) If this method returns false, it means that plugin needs more data from the server to conclude the handshake. In that case next handshake data payload should be read from the server (after possibly writing data from toServer as explained above). Then this method should be called again with the new data in fromServer parameter. In case of errors the method should throw Exception.- 指定者:
nextAuthenticationStep在接口中AuthenticationPlugin<NativePacketPayload>- 覆盖:
nextAuthenticationStep在类中Sha256PasswordPlugin- 参数:
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).- 返回:
- False if more data should be read from the server and next call to this method made, true otherwise.
-
encryptPassword
protected byte[] encryptPassword()
- 覆盖:
encryptPassword在类中Sha256PasswordPlugin
-
-