File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
src/MySqlConnector.Authentication.Ed25519 Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Threading ;
3
+
4
+ namespace MySqlConnector . Authentication . Ed25519 ;
5
+
6
+ /// <summary>
7
+ /// Provides an implementation of the Parsec authentication plugin for MariaDB.
8
+ /// </summary>
9
+ public sealed class ParsecAuthenticationPlugin : IAuthenticationPlugin2
10
+ {
11
+ /// <summary>
12
+ /// Registers the Parsec authentication plugin with MySqlConnector. You must call this method once before
13
+ /// opening a connection that uses Parsec authentication.
14
+ /// </summary>
15
+ public static void Install ( )
16
+ {
17
+ if ( Interlocked . CompareExchange ( ref s_isInstalled , 1 , 0 ) == 0 )
18
+ AuthenticationPlugins . Register ( new ParsecAuthenticationPlugin ( ) ) ;
19
+ }
20
+
21
+ /// <summary>
22
+ /// Gets the authentication plugin name.
23
+ /// </summary>
24
+ public string Name => "client_parsec" ; // TODO: Update with correct name from parsec-spec.txt
25
+
26
+ /// <summary>
27
+ /// Creates the authentication response.
28
+ /// </summary>
29
+ public byte [ ] CreateResponse ( string password , ReadOnlySpan < byte > authenticationData )
30
+ {
31
+ // TODO: Implement Parsec authentication protocol
32
+ throw new NotImplementedException ( ) ;
33
+ }
34
+
35
+ /// <summary>
36
+ /// Creates the Parsec password hash.
37
+ /// </summary>
38
+ public byte [ ] CreatePasswordHash ( string password , ReadOnlySpan < byte > authenticationData )
39
+ {
40
+ // TODO: Implement Parsec password hashing
41
+ throw new NotImplementedException ( ) ;
42
+ }
43
+
44
+ private ParsecAuthenticationPlugin ( )
45
+ {
46
+ }
47
+
48
+ private static int s_isInstalled ;
49
+ }
You can’t perform that action at this time.
0 commit comments