pub struct DhRef<T>(/* private fields */);Implementations§
Source§impl<T> DhRef<T>where
T: HasParams,
impl<T> DhRef<T>where
T: HasParams,
Sourcepub fn params_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
pub fn params_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the parameters into a PEM-encoded PKCS#3 DHparameter structure.
The output will have a header of -----BEGIN DH PARAMETERS-----.
This corresponds to PEM_write_bio_DHparams.
Sourcepub fn params_to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn params_to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the parameters into a DER-encoded PKCS#3 DHparameter structure.
This corresponds to i2d_DHparams.
Sourcepub fn check_key(&self) -> Result<bool, ErrorStack>
pub fn check_key(&self) -> Result<bool, ErrorStack>
Validates DH parameters for correctness
This corresponds to DH_check_key.
Source§impl<T> DhRef<T>where
T: HasPublic,
impl<T> DhRef<T>where
T: HasPublic,
Sourcepub fn public_key(&self) -> &BigNumRef
pub fn public_key(&self) -> &BigNumRef
Returns the public key from the DH instance.
This corresponds to DH_get0_key.
Source§impl<T> DhRef<T>where
T: HasPrivate,
impl<T> DhRef<T>where
T: HasPrivate,
Sourcepub fn compute_key(&self, public_key: &BigNumRef) -> Result<Vec<u8>, ErrorStack>
pub fn compute_key(&self, public_key: &BigNumRef) -> Result<Vec<u8>, ErrorStack>
Computes a shared secret from the own private key and the given public_key.
This corresponds to DH_compute_key.
Sourcepub fn private_key(&self) -> &BigNumRef
pub fn private_key(&self) -> &BigNumRef
Returns the private key from the DH instance.
This corresponds to DH_get0_key.