Struct jormungandr_lib::crypto::key::KeyPair
source · pub struct KeyPair<A: AsymmetricKey>(pub KeyPair<A>);
Expand description
A key pair of the given cryptographic algorithm
it contains the SigningKey
and the Identifier
.
More info at the module documentation
Tuple Fields§
§0: KeyPair<A>
Implementations§
source§impl<A: AsymmetricKey> KeyPair<A>
impl<A: AsymmetricKey> KeyPair<A>
pub fn public_key(&self) -> &PublicKey<<A as AsymmetricKey>::PubAlg>
source§impl<A: AsymmetricKey> KeyPair<A>
impl<A: AsymmetricKey> KeyPair<A>
sourcepub fn generate<RNG>(rng: RNG) -> Selfwhere
RNG: RngCore + CryptoRng,
pub fn generate<RNG>(rng: RNG) -> Selfwhere RNG: RngCore + CryptoRng,
generate a new key pair with the given Random Number Generator
sourcepub fn identifier(&self) -> Identifier<<A as AsymmetricKey>::PubAlg>
pub fn identifier(&self) -> Identifier<<A as AsymmetricKey>::PubAlg>
retrieve the unique Identifier associated to this KeyPair
sourcepub fn signing_key(&self) -> SigningKey<A>
pub fn signing_key(&self) -> SigningKey<A>
retrieve the SigningKey
Trait Implementations§
Auto Trait Implementations§
impl<A> RefUnwindSafe for KeyPair<A>where <<A as AsymmetricKey>::PubAlg as AsymmetricPublicKey>::Public: RefUnwindSafe, <A as AsymmetricKey>::Secret: RefUnwindSafe,
impl<A> Send for KeyPair<A>where <<A as AsymmetricKey>::PubAlg as AsymmetricPublicKey>::Public: Send, <A as AsymmetricKey>::Secret: Send,
impl<A> Sync for KeyPair<A>where <<A as AsymmetricKey>::PubAlg as AsymmetricPublicKey>::Public: Sync, <A as AsymmetricKey>::Secret: Sync,
impl<A> Unpin for KeyPair<A>where <<A as AsymmetricKey>::PubAlg as AsymmetricPublicKey>::Public: Unpin, <A as AsymmetricKey>::Secret: Unpin,
impl<A> UnwindSafe for KeyPair<A>where <<A as AsymmetricKey>::PubAlg as AsymmetricPublicKey>::Public: UnwindSafe, <A as AsymmetricKey>::Secret: UnwindSafe,
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