Introduce SslRef::set_private_key
This commit is contained in:
parent
7ead83cf40
commit
8ab1873d8b
|
|
@ -3563,6 +3563,18 @@ impl SslRef {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Sets the private key.
|
||||
///
|
||||
/// This corresponds to [`SSL_use_PrivateKey`].
|
||||
///
|
||||
/// [`SSL_use_PrivateKey`]: https://www.openssl.org/docs/man1.1.1/man3/SSL_use_PrivateKey.html
|
||||
pub fn set_private_key<T>(&mut self, key: &PKeyRef<T>) -> Result<(), ErrorStack>
|
||||
where
|
||||
T: HasPrivate,
|
||||
{
|
||||
unsafe { cvt(ffi::SSL_use_PrivateKey(self.as_ptr(), key.as_ptr())).map(|_| ()) }
|
||||
}
|
||||
}
|
||||
|
||||
/// An SSL stream midway through the handshake process.
|
||||
|
|
|
|||
Loading…
Reference in New Issue