Class Ed25519PasswordPlugin
- java.lang.Object
-
- org.mariadb.jdbc.plugin.authentication.standard.Ed25519PasswordPlugin
-
- All Implemented Interfaces:
AuthenticationPlugin
public class Ed25519PasswordPlugin extends java.lang.Object implements AuthenticationPlugin
ED25519 password plugin
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringauthenticationDataprivate byte[]seed
-
Constructor Summary
Constructors Constructor Description Ed25519PasswordPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static byte[]ed25519SignWithPassword(java.lang.String password, byte[] seed)Sign passwordbyte[]hash(Credential credential)Return Hashvoidinitialize(java.lang.String authenticationData, byte[] seed, Configuration conf, HostAddress hostAddress)Initialization.booleanisMitMProof()Can plugins is MitM-proof, permitting returning HASHReadableByteBufprocess(Writer out, Reader in, Context context)Process Ed25519 password plugin authentication.java.lang.Stringtype()Authentication plugin type.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mariadb.jdbc.plugin.AuthenticationPlugin
requireSsl
-
-
-
-
Method Detail
-
ed25519SignWithPassword
private static byte[] ed25519SignWithPassword(java.lang.String password, byte[] seed) throws java.sql.SQLExceptionSign password- Parameters:
password- passwordseed- server seed- Returns:
- encrypted value
- Throws:
java.sql.SQLException- if any error occurs
-
type
public java.lang.String type()
Description copied from interface:AuthenticationPluginAuthentication plugin type.- Specified by:
typein interfaceAuthenticationPlugin- Returns:
- authentication plugin type. ex: mysql_native_password
-
initialize
public void initialize(java.lang.String authenticationData, byte[] seed, Configuration conf, HostAddress hostAddress)Initialization.- Specified by:
initializein interfaceAuthenticationPlugin- Parameters:
authenticationData- authentication data (password/token)seed- server provided seedconf- Connection string optionshostAddress- host information
-
process
public ReadableByteBuf process(Writer out, Reader in, Context context) throws java.sql.SQLException, java.io.IOException
Process Ed25519 password plugin authentication. see https://mariadb.com/kb/en/library/authentication-plugin-ed25519/- Specified by:
processin interfaceAuthenticationPlugin- Parameters:
out- out streamin- in streamcontext- connection context- Returns:
- response packet
- Throws:
java.io.IOException- if socket errorjava.sql.SQLException- if plugin exception
-
isMitMProof
public boolean isMitMProof()
Description copied from interface:AuthenticationPluginCan plugins is MitM-proof, permitting returning HASH- Specified by:
isMitMProofin interfaceAuthenticationPlugin- Returns:
- true if permitted
-
hash
public byte[] hash(Credential credential)
Return Hash- Specified by:
hashin interfaceAuthenticationPlugin- Parameters:
credential- Credential- Returns:
- hash
-
-