public class CachingSha2PasswordPlugin extends Object implements AuthenticationPlugin
| Constructor and Description |
|---|
CachingSha2PasswordPlugin() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(String authenticationData,
byte[] seed,
Options options)
Initialized data.
|
String |
name()
Authentication plugin name.
|
Buffer |
process(PacketOutputStream out,
PacketInputStream in,
AtomicInteger sequence)
Process native password plugin authentication. see
https://mariadb.com/kb/en/library/authentication-plugin-mysql_native_password/
|
static byte[] |
sha256encryptPassword(String password,
byte[] seed,
String passwordCharacterEncoding)
Send a SHA-2 encrypted password. encryption XOR(SHA256(password), SHA256(seed,
SHA256(SHA256(password))))
|
String |
type()
Authentication plugin type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmustUseSslpublic static final String TYPE
public static byte[] sha256encryptPassword(String password, byte[] seed, String passwordCharacterEncoding) throws NoSuchAlgorithmException, UnsupportedEncodingException
password - passwordseed - seedpasswordCharacterEncoding - option if not using default byte encodingNoSuchAlgorithmException - if SHA-256 algorithm is unknownUnsupportedEncodingException - if SHA-256 algorithm is unknownpublic String name()
AuthenticationPluginname in interface AuthenticationPluginpublic String type()
AuthenticationPlugintype in interface AuthenticationPluginpublic void initialize(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, AtomicInteger sequence) throws IOException, SQLException
process in interface AuthenticationPluginout - out streamin - in streamsequence - packet sequenceIOException - if socket errorSQLException - if plugin exceptionCopyright © 2020 mariadb.com. All rights reserved.