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
use crate::export::Principal;
pub(crate) mod anonymous;
pub(crate) mod basic;
pub(crate) mod secp256k1;
#[cfg(feature = "pem")]
pub(crate) mod error;
pub use anonymous::AnonymousIdentity;
pub use basic::BasicIdentity;
pub use secp256k1::Secp256k1Identity;
#[cfg(feature = "pem")]
pub use error::PemError;
#[derive(Clone, Debug)]
pub struct Signature {
pub public_key: Option<Vec<u8>>,
pub signature: Option<Vec<u8>>,
}
pub trait Identity: Send + Sync {
fn sender(&self) -> Result<Principal, String>;
fn sign(&self, blob: &[u8]) -> Result<Signature, String>;
}