pub struct KeysDb {
rng: u32,
tcg: TestCryptoGen,
ed25519: HashMap<PublicKey<Ed25519>, EitherEd25519SecretKey>,
}
Fields§
§rng: u32
§tcg: TestCryptoGen
§ed25519: HashMap<PublicKey<Ed25519>, EitherEd25519SecretKey>
Implementations§
source§impl KeysDb
impl KeysDb
pub fn empty() -> Self
pub fn add_key(&mut self, sk: EitherEd25519SecretKey)
sourcepub fn new_ed25519_secret_key(&mut self) -> SecretKey<Ed25519>
pub fn new_ed25519_secret_key(&mut self) -> SecretKey<Ed25519>
Create a new Ed25519 and record it
sourcepub fn new_ed25519_public_key(&mut self) -> PublicKey<Ed25519>
pub fn new_ed25519_public_key(&mut self) -> PublicKey<Ed25519>
same as new_ed25519_secret_key but instead return the public key directly
pub fn new_account_address(&mut self) -> Address
sourcepub fn find_ed25519_secret_key<'a>(
&'a self,
pk: &PublicKey<Ed25519>
) -> Option<&'a EitherEd25519SecretKey>
pub fn find_ed25519_secret_key<'a>( &'a self, pk: &PublicKey<Ed25519> ) -> Option<&'a EitherEd25519SecretKey>
Try to get the associated secret key for a given public key
pub fn find_by_address<'a>( &'a self, addr: &Address ) -> Option<&'a EitherEd25519SecretKey>
Auto Trait Implementations§
impl RefUnwindSafe for KeysDb
impl Send for KeysDb
impl Sync for KeysDb
impl Unpin for KeysDb
impl UnwindSafe for KeysDb
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more