diff options
| author | Steven Fackler <[email protected]> | 2018-09-08 21:13:15 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2018-09-12 19:21:18 -0700 |
| commit | 93a4e96255744363b80603e821e94b551621fbd8 (patch) | |
| tree | 1c1e77369f63d55738a5cbeea65d2d7c515d2971 /openssl-sys/src/pkcs12.rs | |
| parent | clean up example (diff) | |
| download | rust-openssl-93a4e96255744363b80603e821e94b551621fbd8.tar.xz rust-openssl-93a4e96255744363b80603e821e94b551621fbd8.zip | |
Refactor openssl-sys
The old layout tried to structure itself by version but it ended up with
a lot of duplication. Instead, follow the structure of the header files.
Diffstat (limited to 'openssl-sys/src/pkcs12.rs')
| -rw-r--r-- | openssl-sys/src/pkcs12.rs | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/openssl-sys/src/pkcs12.rs b/openssl-sys/src/pkcs12.rs new file mode 100644 index 00000000..72170ea1 --- /dev/null +++ b/openssl-sys/src/pkcs12.rs @@ -0,0 +1,56 @@ +use libc::*; + +use *; + +pub enum PKCS12 {} + +extern "C" { + pub fn PKCS12_free(p12: *mut PKCS12); + pub fn i2d_PKCS12(a: *mut PKCS12, buf: *mut *mut u8) -> c_int; + pub fn d2i_PKCS12(a: *mut *mut PKCS12, pp: *mut *const u8, length: c_long) -> *mut PKCS12; + + pub fn PKCS12_parse( + p12: *mut PKCS12, + pass: *const c_char, + pkey: *mut *mut EVP_PKEY, + cert: *mut *mut X509, + ca: *mut *mut stack_st_X509, + ) -> c_int; +} +cfg_if! { + if #[cfg(ossl110)] { + extern "C" { + pub fn PKCS12_create( + pass: *const c_char, + friendly_name: *const c_char, + pkey: *mut EVP_PKEY, + cert: *mut X509, + ca: *mut stack_st_X509, + nid_key: c_int, + nid_cert: c_int, + iter: c_int, + mac_iter: c_int, + keytype: c_int, + ) -> *mut PKCS12; + } + } else { + extern "C" { + pub fn PKCS12_create( + pass: *mut c_char, + friendly_name: *mut c_char, + pkey: *mut EVP_PKEY, + cert: *mut X509, + ca: *mut stack_st_X509, + nid_key: c_int, + nid_cert: c_int, + iter: c_int, + mac_iter: c_int, + keytype: c_int, + ) -> *mut PKCS12; + } + } +} + +extern "C" { + pub fn i2d_PKCS12_bio(b: *mut BIO, a: *mut PKCS12) -> c_int; +} |