#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ByteArray {
pub data: *mut u8,
pub len: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Attributes {
pub country: ByteArray,
pub organization: ByteArray,
pub organizationalUnit: ByteArray,
pub nameQualifier: ByteArray,
pub state: ByteArray,
pub commonName: ByteArray,
pub serialNumber: ByteArray,
pub locality: ByteArray,
pub title: ByteArray,
pub surname: ByteArray,
pub givenName: ByteArray,
pub initials: ByteArray,
pub pseudonym: ByteArray,
pub generationQualifier: ByteArray,
pub emailAddress: ByteArray,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Certificate {
pub version: ::std::os::raw::c_long,
pub issuer: *mut ::std::os::raw::c_char,
pub subject: *mut ::std::os::raw::c_char,
pub serial: *mut ::std::os::raw::c_char,
pub sha1: ByteArray,
pub sha256: ByteArray,
pub key_alg: *mut ::std::os::raw::c_char,
pub sig_alg: *mut ::std::os::raw::c_char,
pub sig_alg_oid: *mut ::std::os::raw::c_char,
pub not_before: i64,
pub not_after: i64,
pub key: *mut ::std::os::raw::c_char,
pub issuer_attrs: Attributes,
pub subject_attrs: Attributes,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CertificateArray {
pub certs: *mut *mut Certificate,
pub count: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Countersignature {
pub verify_flags: ::std::os::raw::c_int,
pub sign_time: i64,
pub digest_alg: *mut ::std::os::raw::c_char,
pub digest: ByteArray,
pub chain: *mut CertificateArray,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CountersignatureArray {
pub counters: *mut *mut Countersignature,
pub count: usize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Signer {
pub digest: ByteArray,
pub digest_alg: *mut ::std::os::raw::c_char,
pub program_name: *mut ::std::os::raw::c_char,
pub chain: *mut CertificateArray,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Authenticode {
pub verify_flags: ::std::os::raw::c_int,
pub version: ::std::os::raw::c_int,
pub digest_alg: *mut ::std::os::raw::c_char,
pub digest: ByteArray,
pub file_digest: ByteArray,
pub signer: *mut Signer,
pub certs: *mut CertificateArray,
pub countersigs: *mut CountersignatureArray,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct AuthenticodeArray {
pub signatures: *mut *mut Authenticode,
pub count: usize,
}
extern "C" {
pub fn initialize_authenticode_parser();
pub fn parse_authenticode(pe_data: *const u8, pe_len: u64) -> *mut AuthenticodeArray;
pub fn authenticode_new(data: *const u8, len: i32) -> *mut AuthenticodeArray;
pub fn authenticode_array_free(auth: *mut AuthenticodeArray);
}