Struct KeyPair
pub struct KeyPair {
pub public_key: PublicKey,
pub private_key: PrivateKey,
}Fields§
§public_key: PublicKey§private_key: PrivateKeyImplementations§
§impl KeyPair
impl KeyPair
pub fn generate<R>(csprng: &mut R) -> KeyPair
pub fn new(public_key: PublicKey, private_key: PrivateKey) -> KeyPair
pub fn from_public_and_private( public_key: &[u8], private_key: &[u8], ) -> Result<KeyPair, CurveError>
pub fn calculate_signature<R>( &self, message: &[u8], csprng: &mut R, ) -> Result<Box<[u8]>, CurveError>
pub fn calculate_agreement( &self, their_key: &PublicKey, ) -> Result<Box<[u8]>, CurveError>
Trait Implementations§
Source§impl From<IdentityKeyPair> for KeyPair
impl From<IdentityKeyPair> for KeyPair
Source§fn from(value: IdentityKeyPair) -> KeyPair
fn from(value: IdentityKeyPair) -> KeyPair
Converts to this type from the input type.
Source§impl From<KeyPair> for IdentityKeyPair
impl From<KeyPair> for IdentityKeyPair
Source§fn from(value: KeyPair) -> IdentityKeyPair
fn from(value: KeyPair) -> IdentityKeyPair
Converts to this type from the input type.
§impl TryFrom<PrivateKey> for KeyPair
impl TryFrom<PrivateKey> for KeyPair
impl Copy for KeyPair
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].