1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use ;
use ;
/// Trait para tipos que podem ser assinados.
///
/// Define como um tipo gera bytes determinísticos para assinatura.
/// `LogLine` implementa este trait.
/// Assinatura digital de uma mensagem.
///
/// Contém o algoritmo usado e os bytes da assinatura.
/// Em versões futuras, será integrado com `ed25519-dalek` para assinaturas reais.
///
/// # Exemplo
///
/// ```rust
/// use logline_core::Signature;
///
/// let sig = Signature {
/// alg: "ed25519".into(),
/// bytes: vec![0u8; 64],
/// };
/// ```
/// Placeholder error type for signing operations (v0.1.0).
/// Future versions will use proper error types (e.g., ed25519-dalek errors).
;
/// Trait para tipos que podem assinar mensagens.
///
/// Implementações devem assinar os bytes fornecidos e retornar uma `Signature`.
/// Em produção, use implementações reais como `ed25519-dalek::SigningKey`.
///
/// # Exemplo
///
/// ```rust
/// use logline_core::{Signer, Signature, SignError};
///
/// struct NoopSigner;
/// impl Signer for NoopSigner {
/// fn sign(&self, msg: &[u8]) -> Result<Signature, SignError> {
/// Ok(Signature { alg: "none".into(), bytes: msg.to_vec() })
/// }
/// }
/// ```