1
2
3
4
5
6
7
8
9
10
11
12
13
14
use bytes::Bytes;

/// Types can implement to `PrivateKeyDataProvider` to indicate that they will provide
/// unique data from which keys for signing and encryption can be derived.
pub trait PrivateKeyDataProvider {
    /// Returns the private key data.
    fn private_key_data(&self) -> Bytes;
}

impl PrivateKeyDataProvider for dyn AsRef<[u8]> {
    fn private_key_data(&self) -> Bytes {
        self.as_ref().to_vec().into()
    }
}