Package org.mariadb.jdbc.message.server

## Class AuthSwitchPacket

- java.lang.Object
- - org.mariadb.jdbc.message.server.AuthSwitchPacket

All Implemented Interfaces:
  `org.mariadb.jdbc.message.ServerMessage`

    public class AuthSwitchPacket
    extends Object
    implements org.mariadb.jdbc.message.ServerMessage

Authentication switch packet. See https://mariadb.com/kb/en/connection/#authentication-switch-request

### Constructor Summary

Constructors
`AuthSwitchPacket​(String plugin, byte[] seed)` Authentication switch constructor

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static AuthSwitchPacket` `decode​(org.mariadb.jdbc.client.ReadableByteBuf buf)` Decode an AUTH_SWITCH_PACKET from a MYSQL packet.
`String` `getPlugin()` Get authentication switch plugin information
`byte[]` `getSeed()` Get authentication switch seed information
`static byte[]` `getTruncatedSeed​(byte[] seed)` Get truncated seed (seed without ending 0x00 byte)

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AuthSwitchPacket

    public AuthSwitchPacket​(String plugin,
                            byte[] seed)

Authentication switch constructor

Parameters:
  `plugin` - plugin requested
  `seed` - plugin seed

### Method Detail

#### decode

    public static AuthSwitchPacket decode​(org.mariadb.jdbc.client.ReadableByteBuf buf)

Decode an AUTH_SWITCH_PACKET from a MYSQL packet.

Parameters:
  `buf` - packet
Returns:
  Authentication switch packet.

#### getPlugin

    public String getPlugin()

Get authentication switch plugin information

Returns:
  plugin

#### getSeed

    public byte[] getSeed()

Get authentication switch seed information

Returns:
  seed

#### getTruncatedSeed

    public static byte[] getTruncatedSeed​(byte[] seed)

Get truncated seed (seed without ending 0x00 byte)

Parameters:
  `seed` - connection seed
Returns:
  truncated seed