pub trait PrivateKeyDataProvider {
// Required method
fn private_key_data(&self) -> Vec<u8> ⓘ;
}
Expand description
A trait for types that can provide unique data for cryptographic key derivation.
Types implementing PrivateKeyDataProvider
can be used as seed material for
cryptographic key derivation. The provided data should be sufficiently
random and unpredictable to ensure the security of the derived keys.
This trait is particularly useful for:
- Deterministic key generation systems
- Key recovery mechanisms
- Key derivation hierarchies
- Hierarchical deterministic wallet implementations
§Security Considerations
Implementers of this trait should ensure that:
- The data they provide has sufficient entropy
- The data is properly protected in memory
- Any serialization or storage is done securely
- Appropriate zeroization occurs when data is no longer needed
Required Methods§
Sourcefn private_key_data(&self) -> Vec<u8> ⓘ
fn private_key_data(&self) -> Vec<u8> ⓘ
Returns unique data from which cryptographic keys can be derived.
The returned data should be sufficiently random and have enough entropy to serve as the basis for secure cryptographic key derivation.
§Returns
A vector of bytes containing the private key data.
Implementations on Foreign Types§
Source§impl PrivateKeyDataProvider for dyn AsRef<[u8]>
Implementation of PrivateKeyDataProvider
for any type that can be
referenced as a byte slice.
impl PrivateKeyDataProvider for dyn AsRef<[u8]>
Implementation of PrivateKeyDataProvider
for any type that can be
referenced as a byte slice.
This allows any type that implements AsRef<[u8]>
to be used as a source of
private key data.
Implementors§
impl PrivateKeyDataProvider for Seed
Implements PrivateKeyDataProvider to use seed data for key derivation.