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(java.lang.String authenticationData, byte[] seed)
-
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 the server seed with the password.byte[]hash(Credential credential)Return HashbooleanisMitMProof()Can plugins are MitM-proof, permitting returning HASHReadableByteBufprocess(Writer out, Reader in, Context context, boolean sslFingerPrintValidation)Process Ed25519 password plugin authentication.
-
-
-
Method Detail
-
ed25519SignWithPassword
private static byte[] ed25519SignWithPassword(java.lang.String password, byte[] seed)Sign the server seed with the password. This is an RFC 8032 signature where the raw password takes the place of the 32-byte secret seed.- Parameters:
password- passwordseed- server seed- Returns:
- 64-byte signature
-
process
public ReadableByteBuf process(Writer out, Reader in, Context context, boolean sslFingerPrintValidation) throws java.sql.SQLException, java.io.IOException
Process Ed25519 password plugin authentication. see authentication-plugin-ed25519- Specified by:
processin interfaceAuthenticationPlugin- Parameters:
out- out streamin- in streamcontext- connection contextsslFingerPrintValidation- true if SSL certificate fingerprint validation is enabled- 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 are 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
-
-