Top Inners Fields Constructors Methods
com.mysql.cj.protocol.a.authentication

public Class CachingSha2PasswordPlugin

extends Sha256PasswordPlugin
Class Inheritance
Imports
java.security.DigestException, java.util.List, com.mysql.cj.Messages, com.mysql.cj.conf.PropertyKey, com.mysql.cj.exceptions.CJException, .ExceptionFactory, .UnableToConnectException, com.mysql.cj.protocol.Protocol, .Security, com.mysql.cj.protocol.a.NativeConstants, .NativeConstants.IntegerDataType, .NativeConstants.StringLengthDataType, .NativeConstants.StringSelfDataType, .NativePacketPayload, com.mysql.cj.util.StringUtils

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
public static String
private CachingSha2PasswordPlugin.AuthStage
Inherited from com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin:
passwordprotocolpublicKeyRequestedpublicKeyStringseedserverRSAPublicKeyFileusernameCallbackHandler

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.destroy.

Overrides default com.mysql.cj.protocol.AuthenticationPlugin.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[]
public String
getProtocolPluginName()

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.getProtocolPluginName.

Implements com.mysql.cj.protocol.AuthenticationPlugin.getProtocolPluginName.

Returns the client-side name that the MySQL server uses on the wire for this plugin.

public void
init(Protocol<NativePacketPayload>
protocol instance
prot
)

Overrides default com.mysql.cj.protocol.AuthenticationPlugin.init.

We need direct Protocol reference because it isn't available from Connection before authentication complete.

public boolean
nextAuthenticationStep(NativePacketPayload
a buffer containing handshake data payload from server (can be empty).
fromServer
,
List<NativePacketPayload>
list of buffers with data to be sent to the server (the list can be empty, but buffers in the list should contain data).
toServer
)

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.nextAuthenticationStep.

Implements com.mysql.cj.protocol.AuthenticationPlugin.nextAuthenticationStep.

Process authentication handshake data from server and optionally produce data to be sent back to the server.

public void
reset()

Overrides default com.mysql.cj.protocol.AuthenticationPlugin.reset.

Resets the authentication steps sequence.

Inherited from com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin:
encryptPasswordinitisReusablereadRSAKeyrequiresConfidentialitysetAuthenticationParameters

Field Detail

PLUGIN_NAMEback to summary
public static String PLUGIN_NAME

Hides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.PLUGIN_NAME.

stageback to summary
private CachingSha2PasswordPlugin.AuthStage stage

Constructor Detail

CachingSha2PasswordPluginback to summary
public CachingSha2PasswordPlugin()

Method Detail

destroyback to summary
public void destroy()

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.destroy.

Overrides default com.mysql.cj.protocol.AuthenticationPlugin.destroy.

Doc from com.mysql.cj.protocol.AuthenticationPlugin.destroy.

Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.

Annotations
@Override
encryptPasswordback to summary
protected byte[] encryptPassword()

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.encryptPassword.

Annotations
@Override
getProtocolPluginNameback to summary
public String getProtocolPluginName()

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.getProtocolPluginName.

Implements com.mysql.cj.protocol.AuthenticationPlugin.getProtocolPluginName.

Doc from com.mysql.cj.protocol.AuthenticationPlugin.getProtocolPluginName.

Returns the client-side name that the MySQL server uses on the wire for this plugin.

Returns:String

plugin name

Annotations
@Override
initback to summary
public void init(Protocol<NativePacketPayload> prot)

Overrides default com.mysql.cj.protocol.AuthenticationPlugin.init.

Doc from com.mysql.cj.protocol.AuthenticationPlugin.init.

We need direct Protocol reference because it isn't available from Connection before authentication complete.

Parameters
prot:Protocol<NativePacketPayload>

protocol instance

Annotations
@Override
nextAuthenticationStepback to summary
public boolean nextAuthenticationStep(NativePacketPayload fromServer, List<NativePacketPayload> toServer)

Overrides com.mysql.cj.protocol.a.authentication.Sha256PasswordPlugin.nextAuthenticationStep.

Implements com.mysql.cj.protocol.AuthenticationPlugin.nextAuthenticationStep.

Doc from com.mysql.cj.protocol.AuthenticationPlugin.nextAuthenticationStep.

Process authentication handshake data from server and optionally produce data to be sent back to the server. The driver will keep calling this method on each new server packet arrival until either an Exception is thrown (authentication failure, please use appropriate SQLStates) or the number of exchange iterations exceeded max limit or an OK packet is sent by server indicating that the connection has been approved. If, on return from this method, toServer is a non-empty list of buffers, then these buffers will be sent to the server in the same order and without any reads in between them. If toServer is an empty list, no data will be sent to server, driver immediately reads the next packet from server. In case of errors the method should throw Exception.

Parameters
fromServer:NativePacketPayload

a buffer containing handshake data payload from server (can be empty).

toServer:List<NativePacketPayload>

list of buffers with data to be sent to the server (the list can be empty, but buffers in the list should contain data).

Returns:boolean

return value is ignored.

Annotations
@Override
resetback to summary
public void reset()

Overrides default com.mysql.cj.protocol.AuthenticationPlugin.reset.

Doc from com.mysql.cj.protocol.AuthenticationPlugin.reset.

Resets the authentication steps sequence.

Annotations
@Override
com.mysql.cj.protocol.a.authentication back to summary

private final Enum CachingSha2PasswordPlugin.AuthStage

extends Enum<CachingSha2PasswordPlugin.AuthStage>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final CachingSha2PasswordPlugin.AuthStage
public static final CachingSha2PasswordPlugin.AuthStage
public static final CachingSha2PasswordPlugin.AuthStage
public static final CachingSha2PasswordPlugin.AuthStage

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static CachingSha2PasswordPlugin.AuthStage
public static CachingSha2PasswordPlugin.AuthStage[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

FAST_AUTH_COMPLETEback to summary
public static final CachingSha2PasswordPlugin.AuthStage FAST_AUTH_COMPLETE
FAST_AUTH_READ_RESULTback to summary
public static final CachingSha2PasswordPlugin.AuthStage FAST_AUTH_READ_RESULT
FAST_AUTH_SEND_SCRAMBLEback to summary
public static final CachingSha2PasswordPlugin.AuthStage FAST_AUTH_SEND_SCRAMBLE
FULL_AUTHback to summary
public static final CachingSha2PasswordPlugin.AuthStage FULL_AUTH

Constructor Detail

AuthStageback to summary
private AuthStage()

Method Detail

valueOfback to summary
public static CachingSha2PasswordPlugin.AuthStage valueOf(String name)
valuesback to summary
public static CachingSha2PasswordPlugin.AuthStage[] values()