1 // Copyright (c) 2023 Huawei Device Co., Ltd. 2 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // you may not use this file except in compliance with the License. 4 // You may obtain a copy of the License at 5 // 6 // http://www.apache.org/licenses/LICENSE-2.0 7 // 8 // Unless required by applicable law or agreed to in writing, software 9 // distributed under the License is distributed on an "AS IS" BASIS, 10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 // See the License for the specific language governing permissions and 12 // limitations under the License. 13 14 use libc::{c_char, c_int, c_void}; 15 16 use super::bio::BIO; 17 use super::x509::C_X509; 18 19 // callback func 20 pub(crate) type PemPasswordCb = Option< 21 unsafe extern "C" fn( 22 buf: *mut c_char, 23 size: c_int, 24 rwflag: c_int, 25 user_data: *mut c_void, 26 ) -> c_int, 27 >; 28 29 extern "C" { 30 /// The PEM functions read structures in PEM format. PEM_read_bio_X509( bio: *mut BIO, out: *mut *mut C_X509, callback: PemPasswordCb, user_data: *mut c_void, ) -> *mut C_X50931 pub(crate) fn PEM_read_bio_X509( 32 bio: *mut BIO, 33 out: *mut *mut C_X509, 34 callback: PemPasswordCb, 35 user_data: *mut c_void, 36 ) -> *mut C_X509; 37 } 38