pub struct DhRef<T>(_, _);
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
.
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
.