pub struct Dh<T>(_, _);
Implementations
sourceimpl Dh<Params>
impl Dh<Params>
pub fn from_params(
p: BigNum,
g: BigNum,
q: BigNum
) -> Result<Dh<Params>, ErrorStack>
sourcepub fn params_from_pem(pem: &[u8]) -> Result<Dh<Params>, ErrorStack>
pub fn params_from_pem(pem: &[u8]) -> Result<Dh<Params>, ErrorStack>
Deserializes a PEM-encoded PKCS#3 DHpararameters structure.
The input should have a header of -----BEGIN DH PARAMETERS-----
.
This corresponds to PEM_read_bio_DHparams
.
sourcepub fn params_from_der(der: &[u8]) -> Result<Dh<Params>, ErrorStack>
pub fn params_from_der(der: &[u8]) -> Result<Dh<Params>, ErrorStack>
Deserializes a DER-encoded PKCS#3 DHparameters structure.
This corresponds to d2i_DHparams
.
sourcepub fn get_1024_160() -> Result<Dh<Params>, ErrorStack>
pub fn get_1024_160() -> Result<Dh<Params>, ErrorStack>
Requires OpenSSL 1.0.2 or newer.
sourcepub fn get_2048_224() -> Result<Dh<Params>, ErrorStack>
pub fn get_2048_224() -> Result<Dh<Params>, ErrorStack>
Requires OpenSSL 1.0.2 or newer.
sourcepub fn get_2048_256() -> Result<Dh<Params>, ErrorStack>
pub fn get_2048_256() -> Result<Dh<Params>, ErrorStack>
Requires OpenSSL 1.0.2 or newer.
Methods from Deref<Target = DhRef<T>>
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
.
Trait Implementations
sourceimpl<T> ForeignType for Dh<T>
impl<T> ForeignType for Dh<T>
impl<T> Send for Dh<T>
impl<T> Sync for Dh<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Dh<T>where
T: RefUnwindSafe,
impl<T> Unpin for Dh<T>where
T: Unpin,
impl<T> UnwindSafe for Dh<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more