Struct askar_crypto::alg::x25519::X25519KeyPair
source · pub struct X25519KeyPair { /* private fields */ }
Available on crate feature
ed25519
only.Expand description
An X25519 public key or keypair
Trait Implementations§
source§impl Clone for X25519KeyPair
impl Clone for X25519KeyPair
source§fn clone(&self) -> X25519KeyPair
fn clone(&self) -> X25519KeyPair
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for X25519KeyPair
impl Debug for X25519KeyPair
source§impl FromJwk for X25519KeyPair
impl FromJwk for X25519KeyPair
source§impl HasKeyAlg for X25519KeyPair
impl HasKeyAlg for X25519KeyPair
source§impl KeyExchange for X25519KeyPair
impl KeyExchange for X25519KeyPair
source§fn write_key_exchange(
&self,
other: &Self,
out: &mut dyn WriteBuffer
) -> Result<(), Error>
fn write_key_exchange( &self, other: &Self, out: &mut dyn WriteBuffer ) -> Result<(), Error>
Perform a key exchange, writing the result to the provided buffer.
source§fn key_exchange_bytes(&self, other: &Rhs) -> Result<SecretBytes, Error>
fn key_exchange_bytes(&self, other: &Rhs) -> Result<SecretBytes, Error>
Available on crate feature
alloc
only.Perform a key exchange and return a new allocated buffer.
source§impl KeyGen for X25519KeyPair
impl KeyGen for X25519KeyPair
source§impl KeyMeta for X25519KeyPair
impl KeyMeta for X25519KeyPair
source§impl KeyPublicBytes for X25519KeyPair
impl KeyPublicBytes for X25519KeyPair
source§impl KeySecretBytes for X25519KeyPair
impl KeySecretBytes for X25519KeyPair
source§impl KeypairBytes for X25519KeyPair
impl KeypairBytes for X25519KeyPair
source§fn from_keypair_bytes(kp: &[u8]) -> Result<Self, Error>
fn from_keypair_bytes(kp: &[u8]) -> Result<Self, Error>
Create a new key instance from a slice of keypair bytes.
source§fn with_keypair_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O
fn with_keypair_bytes<O>(&self, f: impl FnOnce(Option<&[u8]>) -> O) -> O
Create a new key instance from a slice of keypair bytes.
source§fn to_keypair_bytes_buffer<B: WriteBuffer>(
&self,
out: &mut B
) -> Result<(), Error>
fn to_keypair_bytes_buffer<B: WriteBuffer>( &self, out: &mut B ) -> Result<(), Error>
Write the keypair bytes to a buffer.
source§fn to_keypair_bytes(&self) -> Result<SecretBytes, Error>
fn to_keypair_bytes(&self) -> Result<SecretBytes, Error>
Available on crate feature
alloc
only.Write the keypair bytes to a new allocated buffer.
source§impl KeypairMeta for X25519KeyPair
impl KeypairMeta for X25519KeyPair
source§impl ToJwk for X25519KeyPair
impl ToJwk for X25519KeyPair
source§fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>
fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>
Write the JWK representation to an encoder
source§fn to_jwk_thumbprint(&self, alg: Option<KeyAlg>) -> Result<String, Error>
fn to_jwk_thumbprint(&self, alg: Option<KeyAlg>) -> Result<String, Error>
Available on crate feature
alloc
only.Create the JWK thumbprint of the key
source§fn to_jwk_public(&self, alg: Option<KeyAlg>) -> Result<String, Error>
fn to_jwk_public(&self, alg: Option<KeyAlg>) -> Result<String, Error>
Available on crate feature
alloc
only.Create a JWK of the public key
source§fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error>
fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error>
Available on crate feature
alloc
only.Create a JWK of the secret key
source§impl TryFrom<&Ed25519KeyPair> for X25519KeyPair
impl TryFrom<&Ed25519KeyPair> for X25519KeyPair
Auto Trait Implementations§
impl RefUnwindSafe for X25519KeyPair
impl Send for X25519KeyPair
impl Sync for X25519KeyPair
impl Unpin for X25519KeyPair
impl UnwindSafe for X25519KeyPair
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
source§impl<K> ToPublicBytes for Kwhere
K: KeyPublicBytes,
impl<K> ToPublicBytes for Kwhere
K: KeyPublicBytes,
source§fn write_public_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
fn write_public_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
Write the key public bytes to a buffer.
source§fn to_public_bytes(&self) -> Result<SecretBytes, Error>
fn to_public_bytes(&self) -> Result<SecretBytes, Error>
Available on crate feature
alloc
only.Write the key public bytes to a new allocated buffer.
source§impl<K> ToSecretBytes for Kwhere
K: KeySecretBytes,
impl<K> ToSecretBytes for Kwhere
K: KeySecretBytes,
source§fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
Write the key secret bytes to a buffer.
source§fn to_secret_bytes(&self) -> Result<SecretBytes, Error>
fn to_secret_bytes(&self) -> Result<SecretBytes, Error>
Available on crate feature
alloc
only.Write the key secret bytes to a new allocated buffer.