Class Ed25519Signer
- java.lang.Object
-
- org.mariadb.jdbc.plugin.authentication.standard.Ed25519Signer
-
final class Ed25519Signer extends java.lang.ObjectEd25519 signing (RFC 8032) on top of the vendored ref10 implementation, shared by the client_ed25519 and parsec authentication plugins so that neither depends on a JCA provider.The secret is expanded once with SHA-512 as in RFC 8032 section 5.1.5. parsec passes the 32-byte PBKDF2-derived seed, which yields standard signatures; client_ed25519 passes the raw password in place of the seed, which is the only difference of that scheme with RFC 8032.
-
-
Field Summary
Fields Modifier and Type Field Description private static Ed25519ScalarOpsSCALAR_OPSprivate static EdDSAParameterSpecSPEC
-
Constructor Summary
Constructors Modifier Constructor Description privateEd25519Signer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static byte[]expand(byte[] secret)Expand a secret into the 64-byte private key material: SHA-512 of the secret, whose first 32 bytes are clamped into the scalar and whose last 32 bytes are the nonce prefix.(package private) static byte[]publicKey(byte[] expandedKey)Public key A = a·B for the expanded key.private static java.security.MessageDigestsha512()(package private) static byte[]sign(byte[] expandedKey, byte[] publicKey, byte[] message)Sign a message.
-
-
-
Field Detail
-
SPEC
private static final EdDSAParameterSpec SPEC
-
SCALAR_OPS
private static final Ed25519ScalarOps SCALAR_OPS
-
-
Method Detail
-
expand
static byte[] expand(byte[] secret)
Expand a secret into the 64-byte private key material: SHA-512 of the secret, whose first 32 bytes are clamped into the scalar and whose last 32 bytes are the nonce prefix.- Parameters:
secret- seed (RFC 8032) or raw password (client_ed25519)- Returns:
- 64-byte expanded key
-
publicKey
static byte[] publicKey(byte[] expandedKey)
Public key A = a·B for the expanded key.- Parameters:
expandedKey- expanded key fromexpand(byte[])- Returns:
- 32-byte encoded public key
-
sign
static byte[] sign(byte[] expandedKey, byte[] publicKey, byte[] message)Sign a message.- Parameters:
expandedKey- expanded key fromexpand(byte[])publicKey- public key frompublicKey(byte[])message- message to sign- Returns:
- 64-byte signature R || S
-
sha512
private static java.security.MessageDigest sha512()
-
-