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.
|
static byte[] |
sha256encryptPassword(String password,
byte[] seed,
String passwordCharacterEncoding)
Send a SHA-2 encrypted password.
|
String |
type()
Authentication plugin type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mustUseSsl
public 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()
AuthenticationPlugin
name
in interface AuthenticationPlugin
public String type()
AuthenticationPlugin
type
in interface AuthenticationPlugin
public void initialize(String authenticationData, byte[] seed, Options options)
initialize
in interface AuthenticationPlugin
authenticationData
- 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 AuthenticationPlugin
out
- out streamin
- in streamsequence
- packet sequenceIOException
- if socket errorSQLException
- if plugin exceptionCopyright © 2020 mariadb.com. All rights reserved.