The certificate authentication extension provides cryptographic client authentication during the Wisp v2 handshake. The server sends a 64-byte random challenge; the client signs it with its ed25519 private key and returns the signature along with the SHA-256 hash of its public key. The server verifies the signature against its list of trusted public keys and rejects the connection if verification fails.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MercuryWorkshop/epoxy-tls/llms.txt
Use this file to discover all available pages before exploring further.
Extension details
| Field | Value |
|---|---|
| Extension ID | 0x03 |
| Extension enum | CertAuthProtocolExtension |
| Builder enum | CertAuthProtocolExtensionBuilder |
| Feature gate | certificate (enabled by default) |
| Key algorithm | ed25519 |
Feature requirement
The certificate extension is compiled only when thecertificate feature is active. It is included in the default feature set, so no change to Cargo.toml is needed unless you have disabled default features.
The
certificate feature depends on ed25519, getrandom, and bitflags. On WASM targets you also need the wasm feature so that getrandom can obtain entropy from the browser.Key types
SigningKey (client)
Wraps an Arc<dyn Signer<Signature>> and the SHA-256 hash of the corresponding public key.
SigningKey::new_ed25519(signer, hash).
VerifyKey (server)
Wraps an Arc<dyn Verifier<Signature>> and the SHA-256 hash of the public key it can verify.
VerifyKey::new_ed25519(verifier, hash).
Loading a key from a PKCS#8 PEM file
Theed25519-dalek crate provides DecodePrivateKey for loading PKCS#8 PEM files. The SHA-256 hash is computed over the raw 32-byte public key.
simple-wisp-client’s get_cert function.
Client setup
Create the builder and add it to extensions
Pass
Some(signing_key) to opt into signing, or None if the server marks the extension as optional and you have no key.Server setup
The server holds a list ofVerifyKey values — one per trusted client public key. When a client connects, the server verifies the signature against all keys whose hash matches the one the client advertised.
Collection of trusted client verification keys. The server accepts the client if any key in this list successfully verifies the challenge signature.
When
true, clients that do not present a key are rejected with CertAuthExtensionNoKey. When false, unauthenticated clients proceed if the server decides to permit them.Error handling
| Error variant | When it occurs |
|---|---|
WispError::CertAuthExtensionSigInvalid | The client’s signature did not verify against any trusted key |
WispError::CertAuthExtensionCertTypeInvalid | The client advertised an unsupported certificate type bit flag |
WispError::CertAuthExtensionNoKey | The client builder was created with None (no signing key) but the handshake attempted to produce a signature |