pub struct RustCryptoDhKey { /* private fields */ }Expand description
Finite-field DH handle with validated prime-order domain parameters. Private scalars and shared secrets are never exposed by Debug.
Implementations§
Source§impl RustCryptoDhKey
impl RustCryptoDhKey
Sourcepub fn from_components(
provider: &dyn CryptoProvider,
budget: &mut KeyEstablishmentBudget<'_>,
p: &[u8],
q: &[u8],
generator: &[u8],
private: &[u8],
) -> Result<Self, XmlEncError>
pub fn from_components( provider: &dyn CryptoProvider, budget: &mut KeyEstablishmentBudget<'_>, p: &[u8], q: &[u8], generator: &[u8], private: &[u8], ) -> Result<Self, XmlEncError>
Import unsigned big-endian p/q/g and private x. Validation is charged to the supplied operation before allocating big integers or testing primes. The provider supplies independent random Miller-Rabin bases; failures are propagated, never replaced with deterministic or biased bases.
Sourcepub fn public_key(&self) -> Vec<u8> ⓘ
pub fn public_key(&self) -> Vec<u8> ⓘ
Export the public value with the same fixed octet width as p.
Trait Implementations§
Source§impl Debug for RustCryptoDhKey
impl Debug for RustCryptoDhKey
Source§impl KeyAgreementKey for RustCryptoDhKey
impl KeyAgreementKey for RustCryptoDhKey
Source§fn dh_domain_bits(&self) -> Option<(usize, usize)>
fn dh_domain_bits(&self) -> Option<(usize, usize)>
Public modulus/subgroup bit widths for finite-field DH. Operations use
these to recheck key strength under their own policy; no secret is exported.
Source§fn agree(
&self,
parameters: &KeyAgreementParameters<'_>,
) -> Result<Vec<u8>, ProviderError>
fn agree( &self, parameters: &KeyAgreementParameters<'_>, ) -> Result<Vec<u8>, ProviderError>
Derive the raw shared secret for the supplied peer and parameters.
Source§fn provider_binding(&self) -> Option<&ProviderBinding>
fn provider_binding(&self) -> Option<&ProviderBinding>
External execution domain, when the private key resides outside this process.
Auto Trait Implementations§
impl Freeze for RustCryptoDhKey
impl RefUnwindSafe for RustCryptoDhKey
impl Send for RustCryptoDhKey
impl Sync for RustCryptoDhKey
impl Unpin for RustCryptoDhKey
impl UnsafeUnpin for RustCryptoDhKey
impl UnwindSafe for RustCryptoDhKey
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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