Fix doc links
This commit is contained in:
parent
404a753921
commit
3de1385660
|
|
@ -51,7 +51,6 @@ impl<'a> Deriver<'a> {
|
||||||
///
|
///
|
||||||
/// It can be used to size the buffer passed to [`Deriver::derive`].
|
/// It can be used to size the buffer passed to [`Deriver::derive`].
|
||||||
#[corresponds(EVP_PKEY_derive)]
|
#[corresponds(EVP_PKEY_derive)]
|
||||||
/// [`EVP_PKEY_derive`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_PKEY_derive_init.html
|
|
||||||
pub fn len(&mut self) -> Result<usize, ErrorStack> {
|
pub fn len(&mut self) -> Result<usize, ErrorStack> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut len = 0;
|
let mut len = 0;
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,6 @@ impl Rsa<Public> {
|
||||||
/// `n` is the modulus common to both public and private key.
|
/// `n` is the modulus common to both public and private key.
|
||||||
/// `e` is the public exponent.
|
/// `e` is the public exponent.
|
||||||
#[corresponds(RSA_new)]
|
#[corresponds(RSA_new)]
|
||||||
/// [`RSA_set0_key`]: https://www.openssl.org/docs/man1.1.0/crypto/RSA_set0_key.html
|
|
||||||
pub fn from_public_components(n: BigNum, e: BigNum) -> Result<Rsa<Public>, ErrorStack> {
|
pub fn from_public_components(n: BigNum, e: BigNum) -> Result<Rsa<Public>, ErrorStack> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let rsa = cvt_p(ffi::RSA_new())?;
|
let rsa = cvt_p(ffi::RSA_new())?;
|
||||||
|
|
@ -472,7 +471,6 @@ impl RsaPrivateKeyBuilder {
|
||||||
/// `n` is the modulus common to both public and private key.
|
/// `n` is the modulus common to both public and private key.
|
||||||
/// `e` is the public exponent and `d` is the private exponent.
|
/// `e` is the public exponent and `d` is the private exponent.
|
||||||
#[corresponds(RSA_new)]
|
#[corresponds(RSA_new)]
|
||||||
/// [`RSA_set0_key`]: https://www.openssl.org/docs/man1.1.0/crypto/RSA_set0_key.html
|
|
||||||
pub fn new(n: BigNum, e: BigNum, d: BigNum) -> Result<RsaPrivateKeyBuilder, ErrorStack> {
|
pub fn new(n: BigNum, e: BigNum, d: BigNum) -> Result<RsaPrivateKeyBuilder, ErrorStack> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let rsa = cvt_p(ffi::RSA_new())?;
|
let rsa = cvt_p(ffi::RSA_new())?;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use std::pin::Pin;
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
use std::task::{ready, Context, Poll, Waker};
|
use std::task::{ready, Context, Poll, Waker};
|
||||||
|
|
||||||
/// The type of futures to pass to [`SslContextBuilderExt::set_async_select_certificate_callback`].
|
/// The type of futures to pass to [`SslContextBuilder::set_async_select_certificate_callback`].
|
||||||
pub type BoxSelectCertFuture = ExDataFuture<Result<BoxSelectCertFinish, AsyncSelectCertError>>;
|
pub type BoxSelectCertFuture = ExDataFuture<Result<BoxSelectCertFinish, AsyncSelectCertError>>;
|
||||||
|
|
||||||
/// The type of callbacks returned by [`BoxSelectCertFuture`] methods.
|
/// The type of callbacks returned by [`BoxSelectCertFuture`] methods.
|
||||||
|
|
@ -25,19 +25,19 @@ pub type BoxPrivateKeyMethodFuture =
|
||||||
pub type BoxPrivateKeyMethodFinish =
|
pub type BoxPrivateKeyMethodFinish =
|
||||||
Box<dyn FnOnce(&mut SslRef, &mut [u8]) -> Result<usize, AsyncPrivateKeyMethodError>>;
|
Box<dyn FnOnce(&mut SslRef, &mut [u8]) -> Result<usize, AsyncPrivateKeyMethodError>>;
|
||||||
|
|
||||||
/// The type of futures to pass to [`SslContextBuilderExt::set_async_get_session_callback`].
|
/// The type of futures to pass to [`SslContextBuilder::set_async_get_session_callback`].
|
||||||
pub type BoxGetSessionFuture = ExDataFuture<Option<BoxGetSessionFinish>>;
|
pub type BoxGetSessionFuture = ExDataFuture<Option<BoxGetSessionFinish>>;
|
||||||
|
|
||||||
/// The type of callbacks returned by [`BoxSelectCertFuture`] methods.
|
/// The type of callbacks returned by [`BoxSelectCertFuture`] methods.
|
||||||
pub type BoxGetSessionFinish = Box<dyn FnOnce(&mut SslRef, &[u8]) -> Option<SslSession>>;
|
pub type BoxGetSessionFinish = Box<dyn FnOnce(&mut SslRef, &[u8]) -> Option<SslSession>>;
|
||||||
|
|
||||||
/// The type of futures to pass to [`SslContextBuilderExt::set_async_custom_verify_callback`].
|
/// The type of futures to pass to [`SslContextBuilder::set_async_custom_verify_callback`].
|
||||||
pub type BoxCustomVerifyFuture = ExDataFuture<Result<BoxCustomVerifyFinish, SslAlert>>;
|
pub type BoxCustomVerifyFuture = ExDataFuture<Result<BoxCustomVerifyFinish, SslAlert>>;
|
||||||
|
|
||||||
/// The type of callbacks returned by [`BoxCustomVerifyFuture`] methods.
|
/// The type of callbacks returned by [`BoxCustomVerifyFuture`] methods.
|
||||||
pub type BoxCustomVerifyFinish = Box<dyn FnOnce(&mut SslRef) -> Result<(), SslAlert>>;
|
pub type BoxCustomVerifyFinish = Box<dyn FnOnce(&mut SslRef) -> Result<(), SslAlert>>;
|
||||||
|
|
||||||
/// Convenience alias for futures stored in [`Ssl`] ex data by [`SslContextBuilderExt`] methods.
|
/// Convenience alias for futures stored in [`Ssl`] ex data by [`SslContextBuilder`] methods.
|
||||||
///
|
///
|
||||||
/// Public for documentation purposes.
|
/// Public for documentation purposes.
|
||||||
pub type ExDataFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>;
|
pub type ExDataFuture<T> = Pin<Box<dyn Future<Output = T> + Send>>;
|
||||||
|
|
@ -123,7 +123,7 @@ impl SslContextBuilder {
|
||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// The returned [`SslSession`] must not be associated with a different [`SslContext`].
|
/// The returned [`SslSession`] must not be associated with a different [`SslContextBuilder`].
|
||||||
pub unsafe fn set_async_get_session_callback<F>(&mut self, callback: F)
|
pub unsafe fn set_async_get_session_callback<F>(&mut self, callback: F)
|
||||||
where
|
where
|
||||||
F: Fn(&mut SslRef, &[u8]) -> Option<BoxGetSessionFuture> + Send + Sync + 'static,
|
F: Fn(&mut SslRef, &[u8]) -> Option<BoxGetSessionFuture> + Send + Sync + 'static,
|
||||||
|
|
|
||||||
|
|
@ -167,11 +167,10 @@ impl X509StoreContextRef {
|
||||||
/// * `cert_chain` - The certificates chain.
|
/// * `cert_chain` - The certificates chain.
|
||||||
/// * `with_context` - The closure that is called with the initialized context.
|
/// * `with_context` - The closure that is called with the initialized context.
|
||||||
///
|
///
|
||||||
/// This corresponds to [`X509_STORE_CTX_init`] before calling `with_context` and to
|
/// Calls [`X509_STORE_CTX_cleanup`] after calling `with_context`.
|
||||||
/// [`X509_STORE_CTX_cleanup`] after calling `with_context`.
|
|
||||||
///
|
///
|
||||||
/// [`X509_STORE_CTX_init`]: https://www.openssl.org/docs/man1.0.2/crypto/X509_STORE_CTX_init.html
|
|
||||||
/// [`X509_STORE_CTX_cleanup`]: https://www.openssl.org/docs/man1.0.2/crypto/X509_STORE_CTX_cleanup.html
|
/// [`X509_STORE_CTX_cleanup`]: https://www.openssl.org/docs/man1.0.2/crypto/X509_STORE_CTX_cleanup.html
|
||||||
|
#[corresponds(X509_STORE_CTX_init)]
|
||||||
pub fn init<F, T>(
|
pub fn init<F, T>(
|
||||||
&mut self,
|
&mut self,
|
||||||
trust: &store::X509StoreRef,
|
trust: &store::X509StoreRef,
|
||||||
|
|
@ -1287,10 +1286,7 @@ pub struct X509ReqBuilder(X509Req);
|
||||||
|
|
||||||
impl X509ReqBuilder {
|
impl X509ReqBuilder {
|
||||||
/// Returns a builder for a certificate request.
|
/// Returns a builder for a certificate request.
|
||||||
///
|
#[corresponds(X509_REQ_new)]
|
||||||
/// This corresponds to [`X509_REQ_new`].
|
|
||||||
///
|
|
||||||
///[`X509_REQ_new`]: https://www.openssl.org/docs/man1.1.0/crypto/X509_REQ_new.html
|
|
||||||
pub fn new() -> Result<X509ReqBuilder, ErrorStack> {
|
pub fn new() -> Result<X509ReqBuilder, ErrorStack> {
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::init();
|
ffi::init();
|
||||||
|
|
@ -1299,10 +1295,7 @@ impl X509ReqBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the numerical value of the version field.
|
/// Set the numerical value of the version field.
|
||||||
///
|
#[corresponds(X509_REQ_set_version)]
|
||||||
/// This corresponds to [`X509_REQ_set_version`].
|
|
||||||
///
|
|
||||||
///[`X509_REQ_set_version`]: https://www.openssl.org/docs/man1.1.0/crypto/X509_REQ_set_version.html
|
|
||||||
pub fn set_version(&mut self, version: i32) -> Result<(), ErrorStack> {
|
pub fn set_version(&mut self, version: i32) -> Result<(), ErrorStack> {
|
||||||
unsafe { cvt(ffi::X509_REQ_set_version(self.0.as_ptr(), version.into())).map(|_| ()) }
|
unsafe { cvt(ffi::X509_REQ_set_version(self.0.as_ptr(), version.into())).map(|_| ()) }
|
||||||
}
|
}
|
||||||
|
|
@ -1460,10 +1453,7 @@ impl X509ReqRef {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the public key of the certificate request.
|
/// Returns the public key of the certificate request.
|
||||||
///
|
#[corresponds(X509_REQ_get_pubkey)]
|
||||||
/// This corresponds to [`X509_REQ_get_pubkey"]
|
|
||||||
///
|
|
||||||
/// [`X509_REQ_get_pubkey`]: https://www.openssl.org/docs/man1.1.0/crypto/X509_REQ_get_pubkey.html
|
|
||||||
pub fn public_key(&self) -> Result<PKey<Public>, ErrorStack> {
|
pub fn public_key(&self) -> Result<PKey<Public>, ErrorStack> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let key = cvt_p(ffi::X509_REQ_get_pubkey(self.as_ptr()))?;
|
let key = cvt_p(ffi::X509_REQ_get_pubkey(self.as_ptr()))?;
|
||||||
|
|
@ -1474,10 +1464,7 @@ impl X509ReqRef {
|
||||||
/// Check if the certificate request is signed using the given public key.
|
/// Check if the certificate request is signed using the given public key.
|
||||||
///
|
///
|
||||||
/// Returns `true` if verification succeeds.
|
/// Returns `true` if verification succeeds.
|
||||||
///
|
#[corresponds(X509_REQ_verify)]
|
||||||
/// This corresponds to [`X509_REQ_verify"].
|
|
||||||
///
|
|
||||||
/// [`X509_REQ_verify`]: https://www.openssl.org/docs/man1.1.0/crypto/X509_REQ_verify.html
|
|
||||||
pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack>
|
pub fn verify<T>(&self, key: &PKeyRef<T>) -> Result<bool, ErrorStack>
|
||||||
where
|
where
|
||||||
T: HasPublic,
|
T: HasPublic,
|
||||||
|
|
@ -1486,8 +1473,7 @@ impl X509ReqRef {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the extensions of the certificate request.
|
/// Returns the extensions of the certificate request.
|
||||||
///
|
#[corresponds(X509_REQ_get_extensions)]
|
||||||
/// This corresponds to [`X509_REQ_get_extensions"]
|
|
||||||
pub fn extensions(&self) -> Result<Stack<X509Extension>, ErrorStack> {
|
pub fn extensions(&self) -> Result<Stack<X509Extension>, ErrorStack> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let extensions = cvt_p(ffi::X509_REQ_get_extensions(self.as_ptr()))?;
|
let extensions = cvt_p(ffi::X509_REQ_get_extensions(self.as_ptr()))?;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue