package com.cameleer.server.core.security;

/**
 * Service for Ed25519 digital signatures.
 * <p>
 * Used to sign configuration and command payloads pushed to agents via SSE,
 * allowing agents to verify the authenticity of received data.
 * The keypair is ephemeral (generated at startup); agents receive the public
 * key during registration.
 */
public interface Ed25519SigningService {

    /**
     * Signs the given payload using the server's Ed25519 private key.
     *
     * @param payload the string payload to sign
     * @return Base64-encoded signature bytes
     */
    String sign(String payload);

    /**
     * Returns the server's Ed25519 public key as a Base64-encoded string
     * (X.509 SubjectPublicKeyInfo DER format).
     *
     * @return Base64-encoded public key
     */
    String getPublicKeyBase64();
}
