Fix types
This commit is contained in:
parent
63afe3016c
commit
c2145384a9
|
|
@ -13,8 +13,8 @@ use bio::{MemBio, MemBioSlice};
|
||||||
use error::ErrorStack;
|
use error::ErrorStack;
|
||||||
use libc::c_uint;
|
use libc::c_uint;
|
||||||
use pkey::{HasPrivate, PKeyRef};
|
use pkey::{HasPrivate, PKeyRef};
|
||||||
use stack::Stack;
|
use stack::StackRef;
|
||||||
use x509::X509;
|
use x509::{X509, X509Ref};
|
||||||
use {cvt, cvt_p};
|
use {cvt, cvt_p};
|
||||||
|
|
||||||
bitflags! {
|
bitflags! {
|
||||||
|
|
@ -130,13 +130,16 @@ impl CmsContentInfo {
|
||||||
/// OpenSSL documentation at [`CMS_sign`]
|
/// OpenSSL documentation at [`CMS_sign`]
|
||||||
///
|
///
|
||||||
/// [`CMS_sign`]: https://www.openssl.org/docs/manmaster/man3/CMS_sign.html
|
/// [`CMS_sign`]: https://www.openssl.org/docs/manmaster/man3/CMS_sign.html
|
||||||
pub fn sign<T: HasPrivate>(
|
pub fn sign<T>(
|
||||||
signcert: Option<&X509>,
|
signcert: Option<&X509Ref>,
|
||||||
pkey: Option<&PKeyRef<T>>,
|
pkey: Option<&PKeyRef<T>>,
|
||||||
certs: Option<&Stack<X509>>,
|
certs: Option<&StackRef<X509>>,
|
||||||
data: Option<&[u8]>,
|
data: Option<&[u8]>,
|
||||||
flags: CMSOptions,
|
flags: CMSOptions,
|
||||||
) -> Result<CmsContentInfo, ErrorStack> {
|
) -> Result<CmsContentInfo, ErrorStack>
|
||||||
|
where
|
||||||
|
T: HasPrivate,
|
||||||
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
let signcert = signcert.map_or(ptr::null_mut(), |p| p.as_ptr());
|
let signcert = signcert.map_or(ptr::null_mut(), |p| p.as_ptr());
|
||||||
let pkey = pkey.map_or(ptr::null_mut(), |p| p.as_ptr());
|
let pkey = pkey.map_or(ptr::null_mut(), |p| p.as_ptr());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue