| 1 |
// Licensed under the Apache License, Version 2.0 |
| 2 |
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 3 |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. |
| 4 |
// All files in the project carrying such notice may not be copied, modified, or distributed |
| 5 |
// except according to those terms. |
| 6 |
//! Cryptographic API Prototypes and Definitions |
| 7 |
use ctypes::{c_int, c_uchar, c_uint, c_void}; |
| 8 |
use shared::basetsd::ULONG_PTR; |
| 9 |
use shared::bcrypt::BCRYPT_KEY_HANDLE; |
| 10 |
use shared::guiddef::{GUID, LPCGUID}; |
| 11 |
use shared::minwindef::{ |
| 12 |
BOOL, BYTE, DWORD, FALSE, FILETIME, HKEY, HMODULE, LPFILETIME, LPVOID, PBYTE, PDWORD, |
| 13 |
PFILETIME, TRUE, ULONG, WORD, |
| 14 |
}; |
| 15 |
use um::minwinbase::PSYSTEMTIME; |
| 16 |
use um::ncrypt::NCRYPT_KEY_HANDLE; |
| 17 |
use um::winnt::{ |
| 18 |
CHAR, HANDLE, HRESULT, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PCWSTR, PVOID, PWSTR, WCHAR, |
| 19 |
}; |
| 20 |
use vc::vcruntime::size_t; |
| 21 |
//108 |
| 22 |
#[inline] |
| 23 |
pub fn GET_ALG_CLASS(x: ALG_ID) -> ALG_ID { |
| 24 |
x & (7 << 13) |
| 25 |
} |
| 26 |
#[inline] |
| 27 |
pub fn GET_ALG_TYPE(x: ALG_ID) -> ALG_ID { |
| 28 |
x & (15 << 9) |
| 29 |
} |
| 30 |
#[inline] |
| 31 |
pub fn GET_ALG_SID(x: ALG_ID) -> ALG_ID { |
| 32 |
x & 511 |
| 33 |
} |
| 34 |
pub const ALG_CLASS_ANY: ALG_ID = 0; |
| 35 |
pub const ALG_CLASS_SIGNATURE: ALG_ID = 1 << 13; |
| 36 |
pub const ALG_CLASS_MSG_ENCRYPT: ALG_ID = 2 << 13; |
| 37 |
pub const ALG_CLASS_DATA_ENCRYPT: ALG_ID = 3 << 13; |
| 38 |
pub const ALG_CLASS_HASH: ALG_ID = 4 << 13; |
| 39 |
pub const ALG_CLASS_KEY_EXCHANGE: ALG_ID = 5 << 13; |
| 40 |
pub const ALG_CLASS_ALL: ALG_ID = 7 << 13; |
| 41 |
pub const ALG_TYPE_ANY: ALG_ID = 0; |
| 42 |
pub const ALG_TYPE_DSS: ALG_ID = 1 << 9; |
| 43 |
pub const ALG_TYPE_RSA: ALG_ID = 2 << 9; |
| 44 |
pub const ALG_TYPE_BLOCK: ALG_ID = 3 << 9; |
| 45 |
pub const ALG_TYPE_STREAM: ALG_ID = 4 << 9; |
| 46 |
pub const ALG_TYPE_DH: ALG_ID = 5 << 9; |
| 47 |
pub const ALG_TYPE_SECURECHANNEL: ALG_ID = 6 << 9; |
| 48 |
pub const ALG_TYPE_ECDH: ALG_ID = 7 << 9; |
| 49 |
pub const ALG_TYPE_THIRDPARTY: ALG_ID = 8 << 9; |
| 50 |
pub const ALG_SID_ANY: ALG_ID = 0; |
| 51 |
pub const ALG_SID_THIRDPARTY_ANY: ALG_ID = 0; |
| 52 |
pub const ALG_SID_RSA_ANY: ALG_ID = 0; |
| 53 |
pub const ALG_SID_RSA_PKCS: ALG_ID = 1; |
| 54 |
pub const ALG_SID_RSA_MSATWORK: ALG_ID = 2; |
| 55 |
pub const ALG_SID_RSA_ENTRUST: ALG_ID = 3; |
| 56 |
pub const ALG_SID_RSA_PGP: ALG_ID = 4; |
| 57 |
pub const ALG_SID_DSS_ANY: ALG_ID = 0; |
| 58 |
pub const ALG_SID_DSS_PKCS: ALG_ID = 1; |
| 59 |
pub const ALG_SID_DSS_DMS: ALG_ID = 2; |
| 60 |
pub const ALG_SID_ECDSA: ALG_ID = 3; |
| 61 |
pub const ALG_SID_DES: ALG_ID = 1; |
| 62 |
pub const ALG_SID_3DES: ALG_ID = 3; |
| 63 |
pub const ALG_SID_DESX: ALG_ID = 4; |
| 64 |
pub const ALG_SID_IDEA: ALG_ID = 5; |
| 65 |
pub const ALG_SID_CAST: ALG_ID = 6; |
| 66 |
pub const ALG_SID_SAFERSK64: ALG_ID = 7; |
| 67 |
pub const ALG_SID_SAFERSK128: ALG_ID = 8; |
| 68 |
pub const ALG_SID_3DES_112: ALG_ID = 9; |
| 69 |
pub const ALG_SID_CYLINK_MEK: ALG_ID = 12; |
| 70 |
pub const ALG_SID_RC5: ALG_ID = 13; |
| 71 |
pub const ALG_SID_AES_128: ALG_ID = 14; |
| 72 |
pub const ALG_SID_AES_192: ALG_ID = 15; |
| 73 |
pub const ALG_SID_AES_256: ALG_ID = 16; |
| 74 |
pub const ALG_SID_AES: ALG_ID = 17; |
| 75 |
pub const ALG_SID_SKIPJACK: ALG_ID = 10; |
| 76 |
pub const ALG_SID_TEK: ALG_ID = 11; |
| 77 |
pub const CRYPT_MODE_CBCI: ALG_ID = 6; |
| 78 |
pub const CRYPT_MODE_CFBP: ALG_ID = 7; |
| 79 |
pub const CRYPT_MODE_OFBP: ALG_ID = 8; |
| 80 |
pub const CRYPT_MODE_CBCOFM: ALG_ID = 9; |
| 81 |
pub const CRYPT_MODE_CBCOFMI: ALG_ID = 10; |
| 82 |
pub const ALG_SID_RC2: ALG_ID = 2; |
| 83 |
pub const ALG_SID_RC4: ALG_ID = 1; |
| 84 |
pub const ALG_SID_SEAL: ALG_ID = 2; |
| 85 |
pub const ALG_SID_DH_SANDF: ALG_ID = 1; |
| 86 |
pub const ALG_SID_DH_EPHEM: ALG_ID = 2; |
| 87 |
pub const ALG_SID_AGREED_KEY_ANY: ALG_ID = 3; |
| 88 |
pub const ALG_SID_KEA: ALG_ID = 4; |
| 89 |
pub const ALG_SID_ECDH: ALG_ID = 5; |
| 90 |
pub const ALG_SID_ECDH_EPHEM: ALG_ID = 6; |
| 91 |
pub const ALG_SID_MD2: ALG_ID = 1; |
| 92 |
pub const ALG_SID_MD4: ALG_ID = 2; |
| 93 |
pub const ALG_SID_MD5: ALG_ID = 3; |
| 94 |
pub const ALG_SID_SHA: ALG_ID = 4; |
| 95 |
pub const ALG_SID_SHA1: ALG_ID = 4; |
| 96 |
pub const ALG_SID_MAC: ALG_ID = 5; |
| 97 |
pub const ALG_SID_RIPEMD: ALG_ID = 6; |
| 98 |
pub const ALG_SID_RIPEMD160: ALG_ID = 7; |
| 99 |
pub const ALG_SID_SSL3SHAMD5: ALG_ID = 8; |
| 100 |
pub const ALG_SID_HMAC: ALG_ID = 9; |
| 101 |
pub const ALG_SID_TLS1PRF: ALG_ID = 10; |
| 102 |
pub const ALG_SID_HASH_REPLACE_OWF: ALG_ID = 11; |
| 103 |
pub const ALG_SID_SHA_256: ALG_ID = 12; |
| 104 |
pub const ALG_SID_SHA_384: ALG_ID = 13; |
| 105 |
pub const ALG_SID_SHA_512: ALG_ID = 14; |
| 106 |
pub const ALG_SID_SSL3_MASTER: ALG_ID = 1; |
| 107 |
pub const ALG_SID_SCHANNEL_MASTER_HASH: ALG_ID = 2; |
| 108 |
pub const ALG_SID_SCHANNEL_MAC_KEY: ALG_ID = 3; |
| 109 |
pub const ALG_SID_PCT1_MASTER: ALG_ID = 4; |
| 110 |
pub const ALG_SID_SSL2_MASTER: ALG_ID = 5; |
| 111 |
pub const ALG_SID_TLS1_MASTER: ALG_ID = 6; |
| 112 |
pub const ALG_SID_SCHANNEL_ENC_KEY: ALG_ID = 7; |
| 113 |
pub const ALG_SID_ECMQV: ALG_ID = 1; |
| 114 |
pub const ALG_SID_EXAMPLE: ALG_ID = 80; |
| 115 |
pub type ALG_ID = c_uint; |
| 116 |
pub const CALG_MD2: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2; |
| 117 |
pub const CALG_MD4: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4; |
| 118 |
pub const CALG_MD5: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5; |
| 119 |
pub const CALG_SHA: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA; |
| 120 |
pub const CALG_SHA1: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1; |
| 121 |
pub const CALG_MAC: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC; |
| 122 |
pub const CALG_RSA_SIGN: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY; |
| 123 |
pub const CALG_DSS_SIGN: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY; |
| 124 |
pub const CALG_NO_SIGN: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY; |
| 125 |
pub const CALG_RSA_KEYX: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY; |
| 126 |
pub const CALG_DES: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DES; |
| 127 |
pub const CALG_3DES_112: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES_112; |
| 128 |
pub const CALG_3DES: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_3DES; |
| 129 |
pub const CALG_DESX: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_DESX; |
| 130 |
pub const CALG_RC2: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC2; |
| 131 |
pub const CALG_RC4: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_RC4; |
| 132 |
pub const CALG_SEAL: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_STREAM | ALG_SID_SEAL; |
| 133 |
pub const CALG_DH_SF: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_SANDF; |
| 134 |
pub const CALG_DH_EPHEM: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_DH_EPHEM; |
| 135 |
pub const CALG_AGREEDKEY_ANY: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH |
| 136 |
| ALG_SID_AGREED_KEY_ANY; |
| 137 |
pub const CALG_KEA_KEYX: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_KEA; |
| 138 |
pub const CALG_HUGHES_MD5: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_MD5; |
| 139 |
pub const CALG_SKIPJACK: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_SKIPJACK; |
| 140 |
pub const CALG_TEK: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_TEK; |
| 141 |
pub const CALG_CYLINK_MEK: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_CYLINK_MEK; |
| 142 |
pub const CALG_SSL3_SHAMD5: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5; |
| 143 |
pub const CALG_SSL3_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 144 |
| ALG_SID_SSL3_MASTER; |
| 145 |
pub const CALG_SCHANNEL_MASTER_HASH: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 146 |
| ALG_SID_SCHANNEL_MASTER_HASH; |
| 147 |
pub const CALG_SCHANNEL_MAC_KEY: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 148 |
| ALG_SID_SCHANNEL_MAC_KEY; |
| 149 |
pub const CALG_SCHANNEL_ENC_KEY: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 150 |
| ALG_SID_SCHANNEL_ENC_KEY; |
| 151 |
pub const CALG_PCT1_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 152 |
| ALG_SID_PCT1_MASTER; |
| 153 |
pub const CALG_SSL2_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 154 |
| ALG_SID_SSL2_MASTER; |
| 155 |
pub const CALG_TLS1_MASTER: ALG_ID = ALG_CLASS_MSG_ENCRYPT | ALG_TYPE_SECURECHANNEL |
| 156 |
| ALG_SID_TLS1_MASTER; |
| 157 |
pub const CALG_RC5: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_RC5; |
| 158 |
pub const CALG_HMAC: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC; |
| 159 |
pub const CALG_TLS1PRF: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF; |
| 160 |
pub const CALG_HASH_REPLACE_OWF: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF; |
| 161 |
pub const CALG_AES_128: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_128; |
| 162 |
pub const CALG_AES_192: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_192; |
| 163 |
pub const CALG_AES_256: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES_256; |
| 164 |
pub const CALG_AES: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_BLOCK | ALG_SID_AES; |
| 165 |
pub const CALG_SHA_256: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256; |
| 166 |
pub const CALG_SHA_384: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384; |
| 167 |
pub const CALG_SHA_512: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512; |
| 168 |
pub const CALG_ECDH: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_DH | ALG_SID_ECDH; |
| 169 |
pub const CALG_ECDH_EPHEM: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ECDH | ALG_SID_ECDH_EPHEM; |
| 170 |
pub const CALG_ECMQV: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_ANY | ALG_SID_ECMQV; |
| 171 |
pub const CALG_ECDSA: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_ECDSA; |
| 172 |
pub const CALG_NULLCIPHER: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_ANY | 0; |
| 173 |
pub const CALG_THIRDPARTY_KEY_EXCHANGE: ALG_ID = ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_THIRDPARTY |
| 174 |
| ALG_SID_THIRDPARTY_ANY; |
| 175 |
pub const CALG_THIRDPARTY_SIGNATURE: ALG_ID = ALG_CLASS_SIGNATURE | ALG_TYPE_THIRDPARTY |
| 176 |
| ALG_SID_THIRDPARTY_ANY; |
| 177 |
pub const CALG_THIRDPARTY_CIPHER: ALG_ID = ALG_CLASS_DATA_ENCRYPT | ALG_TYPE_THIRDPARTY |
| 178 |
| ALG_SID_THIRDPARTY_ANY; |
| 179 |
pub const CALG_THIRDPARTY_HASH: ALG_ID = ALG_CLASS_HASH | ALG_TYPE_THIRDPARTY |
| 180 |
| ALG_SID_THIRDPARTY_ANY; |
| 181 |
pub type HCRYPTPROV = ULONG_PTR; |
| 182 |
pub type HCRYPTKEY = ULONG_PTR; |
| 183 |
pub type HCRYPTHASH = ULONG_PTR; |
| 184 |
pub const CRYPT_VERIFYCONTEXT: DWORD = 0xF0000000; |
| 185 |
pub const CRYPT_NEWKEYSET: DWORD = 0x00000008; |
| 186 |
pub const CRYPT_DELETEKEYSET: DWORD = 0x00000010; |
| 187 |
pub const CRYPT_MACHINE_KEYSET: DWORD = 0x00000020; |
| 188 |
pub const CRYPT_SILENT: DWORD = 0x00000040; |
| 189 |
pub const CRYPT_DEFAULT_CONTAINER_OPTIONAL: DWORD = 0x00000080; |
| 190 |
pub const CRYPT_EXPORTABLE: DWORD = 0x00000001; |
| 191 |
pub const CRYPT_USER_PROTECTED: DWORD = 0x00000002; |
| 192 |
pub const CRYPT_CREATE_SALT: DWORD = 0x00000004; |
| 193 |
pub const CRYPT_UPDATE_KEY: DWORD = 0x00000008; |
| 194 |
pub const CRYPT_NO_SALT: DWORD = 0x00000010; |
| 195 |
pub const CRYPT_PREGEN: DWORD = 0x00000040; |
| 196 |
pub const CRYPT_RECIPIENT: DWORD = 0x00000010; |
| 197 |
pub const CRYPT_INITIATOR: DWORD = 0x00000040; |
| 198 |
pub const CRYPT_ONLINE: DWORD = 0x00000080; |
| 199 |
pub const CRYPT_SF: DWORD = 0x00000100; |
| 200 |
pub const CRYPT_CREATE_IV: DWORD = 0x00000200; |
| 201 |
pub const CRYPT_KEK: DWORD = 0x00000400; |
| 202 |
pub const CRYPT_DATA_KEY: DWORD = 0x00000800; |
| 203 |
pub const CRYPT_VOLATILE: DWORD = 0x00001000; |
| 204 |
pub const CRYPT_SGCKEY: DWORD = 0x00002000; |
| 205 |
pub const CRYPT_USER_PROTECTED_STRONG: DWORD = 0x00100000; |
| 206 |
pub const CRYPT_ARCHIVABLE: DWORD = 0x00004000; |
| 207 |
pub const CRYPT_FORCE_KEY_PROTECTION_HIGH: DWORD = 0x00008000; |
| 208 |
pub const RSA1024BIT_KEY: DWORD = 0x04000000; |
| 209 |
pub const CRYPT_SERVER: DWORD = 0x00000400; |
| 210 |
pub const KEY_LENGTH_MASK: DWORD = 0xFFFF0000; |
| 211 |
pub const CRYPT_Y_ONLY: DWORD = 0x00000001; |
| 212 |
pub const CRYPT_SSL2_FALLBACK: DWORD = 0x00000002; |
| 213 |
pub const CRYPT_DESTROYKEY: DWORD = 0x00000004; |
| 214 |
pub const CRYPT_OAEP: DWORD = 0x00000040; |
| 215 |
pub const CRYPT_BLOB_VER3: DWORD = 0x00000080; |
| 216 |
pub const CRYPT_IPSEC_HMAC_KEY: DWORD = 0x00000100; |
| 217 |
pub const CRYPT_DECRYPT_RSA_NO_PADDING_CHECK: DWORD = 0x00000020; |
| 218 |
pub const CRYPT_SECRETDIGEST: DWORD = 0x00000001; |
| 219 |
pub const CRYPT_OWF_REPL_LM_HASH: DWORD = 0x00000001; |
| 220 |
pub const CRYPT_LITTLE_ENDIAN: DWORD = 0x00000001; |
| 221 |
pub const CRYPT_NOHASHOID: DWORD = 0x00000001; |
| 222 |
pub const CRYPT_TYPE2_FORMAT: DWORD = 0x00000002; |
| 223 |
pub const CRYPT_X931_FORMAT: DWORD = 0x00000004; |
| 224 |
pub const CRYPT_MACHINE_DEFAULT: DWORD = 0x00000001; |
| 225 |
pub const CRYPT_USER_DEFAULT: DWORD = 0x00000002; |
| 226 |
pub const CRYPT_DELETE_DEFAULT: DWORD = 0x00000004; |
| 227 |
pub const SIMPLEBLOB: DWORD = 0x1; |
| 228 |
pub const PUBLICKEYBLOB: DWORD = 0x6; |
| 229 |
pub const PRIVATEKEYBLOB: DWORD = 0x7; |
| 230 |
pub const PLAINTEXTKEYBLOB: DWORD = 0x8; |
| 231 |
pub const OPAQUEKEYBLOB: DWORD = 0x9; |
| 232 |
pub const PUBLICKEYBLOBEX: DWORD = 0xA; |
| 233 |
pub const SYMMETRICWRAPKEYBLOB: DWORD = 0xB; |
| 234 |
pub const KEYSTATEBLOB: DWORD = 0xC; |
| 235 |
pub const AT_KEYEXCHANGE: DWORD = 1; |
| 236 |
pub const AT_SIGNATURE: DWORD = 2; |
| 237 |
pub const CRYPT_USERDATA: DWORD = 1; |
| 238 |
pub const KP_IV: DWORD = 1; |
| 239 |
pub const KP_SALT: DWORD = 2; |
| 240 |
pub const KP_PADDING: DWORD = 3; |
| 241 |
pub const KP_MODE: DWORD = 4; |
| 242 |
pub const KP_MODE_BITS: DWORD = 5; |
| 243 |
pub const KP_PERMISSIONS: DWORD = 6; |
| 244 |
pub const KP_ALGID: DWORD = 7; |
| 245 |
pub const KP_BLOCKLEN: DWORD = 8; |
| 246 |
pub const KP_KEYLEN: DWORD = 9; |
| 247 |
pub const KP_SALT_EX: DWORD = 10; |
| 248 |
pub const KP_P: DWORD = 11; |
| 249 |
pub const KP_G: DWORD = 12; |
| 250 |
pub const KP_Q: DWORD = 13; |
| 251 |
pub const KP_X: DWORD = 14; |
| 252 |
pub const KP_Y: DWORD = 15; |
| 253 |
pub const KP_RA: DWORD = 16; |
| 254 |
pub const KP_RB: DWORD = 17; |
| 255 |
pub const KP_INFO: DWORD = 18; |
| 256 |
pub const KP_EFFECTIVE_KEYLEN: DWORD = 19; |
| 257 |
pub const KP_SCHANNEL_ALG: DWORD = 20; |
| 258 |
pub const KP_CLIENT_RANDOM: DWORD = 21; |
| 259 |
pub const KP_SERVER_RANDOM: DWORD = 22; |
| 260 |
pub const KP_RP: DWORD = 23; |
| 261 |
pub const KP_PRECOMP_MD5: DWORD = 24; |
| 262 |
pub const KP_PRECOMP_SHA: DWORD = 25; |
| 263 |
pub const KP_CERTIFICATE: DWORD = 26; |
| 264 |
pub const KP_CLEAR_KEY: DWORD = 27; |
| 265 |
pub const KP_PUB_EX_LEN: DWORD = 28; |
| 266 |
pub const KP_PUB_EX_VAL: DWORD = 29; |
| 267 |
pub const KP_KEYVAL: DWORD = 30; |
| 268 |
pub const KP_ADMIN_PIN: DWORD = 31; |
| 269 |
pub const KP_KEYEXCHANGE_PIN: DWORD = 32; |
| 270 |
pub const KP_SIGNATURE_PIN: DWORD = 33; |
| 271 |
pub const KP_PREHASH: DWORD = 34; |
| 272 |
pub const KP_ROUNDS: DWORD = 35; |
| 273 |
pub const KP_OAEP_PARAMS: DWORD = 36; |
| 274 |
pub const KP_CMS_KEY_INFO: DWORD = 37; |
| 275 |
pub const KP_CMS_DH_KEY_INFO: DWORD = 38; |
| 276 |
pub const KP_PUB_PARAMS: DWORD = 39; |
| 277 |
pub const KP_VERIFY_PARAMS: DWORD = 40; |
| 278 |
pub const KP_HIGHEST_VERSION: DWORD = 41; |
| 279 |
pub const KP_GET_USE_COUNT: DWORD = 42; |
| 280 |
pub const KP_PIN_ID: DWORD = 43; |
| 281 |
pub const KP_PIN_INFO: DWORD = 44; |
| 282 |
pub const PKCS5_PADDING: DWORD = 1; |
| 283 |
pub const RANDOM_PADDING: DWORD = 2; |
| 284 |
pub const ZERO_PADDING: DWORD = 3; |
| 285 |
pub const CRYPT_MODE_CBC: DWORD = 1; |
| 286 |
pub const CRYPT_MODE_ECB: DWORD = 2; |
| 287 |
pub const CRYPT_MODE_OFB: DWORD = 3; |
| 288 |
pub const CRYPT_MODE_CFB: DWORD = 4; |
| 289 |
pub const CRYPT_MODE_CTS: DWORD = 5; |
| 290 |
pub const CRYPT_ENCRYPT: DWORD = 0x0001; |
| 291 |
pub const CRYPT_DECRYPT: DWORD = 0x0002; |
| 292 |
pub const CRYPT_EXPORT: DWORD = 0x0004; |
| 293 |
pub const CRYPT_READ: DWORD = 0x0008; |
| 294 |
pub const CRYPT_WRITE: DWORD = 0x0010; |
| 295 |
pub const CRYPT_MAC: DWORD = 0x0020; |
| 296 |
pub const CRYPT_EXPORT_KEY: DWORD = 0x0040; |
| 297 |
pub const CRYPT_IMPORT_KEY: DWORD = 0x0080; |
| 298 |
pub const CRYPT_ARCHIVE: DWORD = 0x0100; |
| 299 |
pub const HP_ALGID: DWORD = 0x0001; |
| 300 |
pub const HP_HASHVAL: DWORD = 0x0002; |
| 301 |
pub const HP_HASHSIZE: DWORD = 0x0004; |
| 302 |
pub const HP_HMAC_INFO: DWORD = 0x0005; |
| 303 |
pub const HP_TLS1PRF_LABEL: DWORD = 0x0006; |
| 304 |
pub const HP_TLS1PRF_SEED: DWORD = 0x0007; |
| 305 |
pub const CRYPT_FAILED: BOOL = FALSE; |
| 306 |
pub const CRYPT_SUCCEED: BOOL = TRUE; |
| 307 |
#[inline] |
| 308 |
pub fn RCRYPT_SUCCEEDED(rt: BOOL) -> bool { |
| 309 |
rt == CRYPT_SUCCEED |
| 310 |
} |
| 311 |
#[inline] |
| 312 |
pub fn RCRYPT_FAILED(rt: BOOL) -> bool { |
| 313 |
rt == CRYPT_FAILED |
| 314 |
} |
| 315 |
pub const PP_ENUMALGS: DWORD = 1; |
| 316 |
pub const PP_ENUMCONTAINERS: DWORD = 2; |
| 317 |
pub const PP_IMPTYPE: DWORD = 3; |
| 318 |
pub const PP_NAME: DWORD = 4; |
| 319 |
pub const PP_VERSION: DWORD = 5; |
| 320 |
pub const PP_CONTAINER: DWORD = 6; |
| 321 |
pub const PP_CHANGE_PASSWORD: DWORD = 7; |
| 322 |
pub const PP_KEYSET_SEC_DESCR: DWORD = 8; |
| 323 |
pub const PP_CERTCHAIN: DWORD = 9; |
| 324 |
pub const PP_KEY_TYPE_SUBTYPE: DWORD = 10; |
| 325 |
pub const PP_PROVTYPE: DWORD = 16; |
| 326 |
pub const PP_KEYSTORAGE: DWORD = 17; |
| 327 |
pub const PP_APPLI_CERT: DWORD = 18; |
| 328 |
pub const PP_SYM_KEYSIZE: DWORD = 19; |
| 329 |
pub const PP_SESSION_KEYSIZE: DWORD = 20; |
| 330 |
pub const PP_UI_PROMPT: DWORD = 21; |
| 331 |
pub const PP_ENUMALGS_EX: DWORD = 22; |
| 332 |
pub const PP_ENUMMANDROOTS: DWORD = 25; |
| 333 |
pub const PP_ENUMELECTROOTS: DWORD = 26; |
| 334 |
pub const PP_KEYSET_TYPE: DWORD = 27; |
| 335 |
pub const PP_ADMIN_PIN: DWORD = 31; |
| 336 |
pub const PP_KEYEXCHANGE_PIN: DWORD = 32; |
| 337 |
pub const PP_SIGNATURE_PIN: DWORD = 33; |
| 338 |
pub const PP_SIG_KEYSIZE_INC: DWORD = 34; |
| 339 |
pub const PP_KEYX_KEYSIZE_INC: DWORD = 35; |
| 340 |
pub const PP_UNIQUE_CONTAINER: DWORD = 36; |
| 341 |
pub const PP_SGC_INFO: DWORD = 37; |
| 342 |
pub const PP_USE_HARDWARE_RNG: DWORD = 38; |
| 343 |
pub const PP_KEYSPEC: DWORD = 39; |
| 344 |
pub const PP_ENUMEX_SIGNING_PROT: DWORD = 40; |
| 345 |
pub const PP_CRYPT_COUNT_KEY_USE: DWORD = 41; |
| 346 |
pub const PP_USER_CERTSTORE: DWORD = 42; |
| 347 |
pub const PP_SMARTCARD_READER: DWORD = 43; |
| 348 |
pub const PP_SMARTCARD_GUID: DWORD = 45; |
| 349 |
pub const PP_ROOT_CERTSTORE: DWORD = 46; |
| 350 |
pub const PP_SMARTCARD_READER_ICON: DWORD = 47; |
| 351 |
pub const CRYPT_FIRST: DWORD = 1; |
| 352 |
pub const CRYPT_NEXT: DWORD = 2; |
| 353 |
pub const CRYPT_SGC_ENUM: DWORD = 4; |
| 354 |
pub const CRYPT_IMPL_HARDWARE: DWORD = 1; |
| 355 |
pub const CRYPT_IMPL_SOFTWARE: DWORD = 2; |
| 356 |
pub const CRYPT_IMPL_MIXED: DWORD = 3; |
| 357 |
pub const CRYPT_IMPL_UNKNOWN: DWORD = 4; |
| 358 |
pub const CRYPT_IMPL_REMOVABLE: DWORD = 8; |
| 359 |
pub const CRYPT_SEC_DESCR: DWORD = 0x00000001; |
| 360 |
pub const CRYPT_PSTORE: DWORD = 0x00000002; |
| 361 |
pub const CRYPT_UI_PROMPT: DWORD = 0x00000004; |
| 362 |
pub const CRYPT_FLAG_PCT1: DWORD = 0x0001; |
| 363 |
pub const CRYPT_FLAG_SSL2: DWORD = 0x0002; |
| 364 |
pub const CRYPT_FLAG_SSL3: DWORD = 0x0004; |
| 365 |
pub const CRYPT_FLAG_TLS1: DWORD = 0x0008; |
| 366 |
pub const CRYPT_FLAG_IPSEC: DWORD = 0x0010; |
| 367 |
pub const CRYPT_FLAG_SIGNING: DWORD = 0x0020; |
| 368 |
pub const CRYPT_SGC: DWORD = 0x0001; |
| 369 |
pub const CRYPT_FASTSGC: DWORD = 0x0002; |
| 370 |
pub const PP_CLIENT_HWND: DWORD = 1; |
| 371 |
pub const PP_CONTEXT_INFO: DWORD = 11; |
| 372 |
pub const PP_KEYEXCHANGE_KEYSIZE: DWORD = 12; |
| 373 |
pub const PP_SIGNATURE_KEYSIZE: DWORD = 13; |
| 374 |
pub const PP_KEYEXCHANGE_ALG: DWORD = 14; |
| 375 |
pub const PP_SIGNATURE_ALG: DWORD = 15; |
| 376 |
pub const PP_DELETEKEY: DWORD = 24; |
| 377 |
pub const PP_PIN_PROMPT_STRING: DWORD = 44; |
| 378 |
pub const PP_SECURE_KEYEXCHANGE_PIN: DWORD = 47; |
| 379 |
pub const PP_SECURE_SIGNATURE_PIN: DWORD = 48; |
| 380 |
pub const PROV_RSA_FULL: DWORD = 1; |
| 381 |
pub const PROV_RSA_SIG: DWORD = 2; |
| 382 |
pub const PROV_DSS: DWORD = 3; |
| 383 |
pub const PROV_FORTEZZA: DWORD = 4; |
| 384 |
pub const PROV_MS_EXCHANGE: DWORD = 5; |
| 385 |
pub const PROV_SSL: DWORD = 6; |
| 386 |
pub const PROV_RSA_SCHANNEL: DWORD = 12; |
| 387 |
pub const PROV_DSS_DH: DWORD = 13; |
| 388 |
pub const PROV_EC_ECDSA_SIG: DWORD = 14; |
| 389 |
pub const PROV_EC_ECNRA_SIG: DWORD = 15; |
| 390 |
pub const PROV_EC_ECDSA_FULL: DWORD = 16; |
| 391 |
pub const PROV_EC_ECNRA_FULL: DWORD = 17; |
| 392 |
pub const PROV_DH_SCHANNEL: DWORD = 18; |
| 393 |
pub const PROV_SPYRUS_LYNKS: DWORD = 20; |
| 394 |
pub const PROV_RNG: DWORD = 21; |
| 395 |
pub const PROV_INTEL_SEC: DWORD = 22; |
| 396 |
pub const PROV_REPLACE_OWF: DWORD = 23; |
| 397 |
pub const PROV_RSA_AES: DWORD = 24; |
| 398 |
pub const MS_DEF_PROV: &'static str = "Microsoft Base Cryptographic Provider v1.0"; |
| 399 |
pub const MS_ENHANCED_PROV: &'static str = "Microsoft Enhanced Cryptographic Provider v1.0"; |
| 400 |
pub const MS_STRONG_PROV: &'static str = "Microsoft Strong Cryptographic Provider"; |
| 401 |
pub const MS_DEF_RSA_SIG_PROV: &'static str = "Microsoft RSA Signature Cryptographic Provider"; |
| 402 |
pub const MS_DEF_RSA_SCHANNEL_PROV: &'static str = "Microsoft RSA SChannel Cryptographic Provider"; |
| 403 |
pub const MS_DEF_DSS_PROV: &'static str = "Microsoft Base DSS Cryptographic Provider"; |
| 404 |
pub const MS_DEF_DSS_DH_PROV: &'static str |
| 405 |
= "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"; |
| 406 |
pub const MS_ENH_DSS_DH_PROV: &'static str |
| 407 |
= "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider"; |
| 408 |
pub const MS_DEF_DH_SCHANNEL_PROV: &'static str = "Microsoft DH SChannel Cryptographic Provider"; |
| 409 |
pub const MS_SCARD_PROV: &'static str = "Microsoft Base Smart Card Crypto Provider"; |
| 410 |
pub const MS_ENH_RSA_AES_PROV: &'static str |
| 411 |
= "Microsoft Enhanced RSA and AES Cryptographic Provider"; |
| 412 |
pub const MS_ENH_RSA_AES_PROV_XP: &'static str |
| 413 |
= "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)"; |
| 414 |
pub const MAXUIDLEN: usize = 64; |
| 415 |
pub const EXPO_OFFLOAD_REG_VALUE: &'static str = "ExpoOffload"; |
| 416 |
pub const EXPO_OFFLOAD_FUNC_NAME: &'static str = "OffloadModExpo"; |
| 417 |
pub const szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS: &'static str |
| 418 |
= "Software\\Policies\\Microsoft\\Cryptography"; |
| 419 |
pub const szKEY_CACHE_ENABLED: &'static str = "CachePrivateKeys"; |
| 420 |
pub const szKEY_CACHE_SECONDS: &'static str = "PrivateKeyLifetimeSeconds"; |
| 421 |
pub const szPRIV_KEY_CACHE_MAX_ITEMS: &'static str = "PrivKeyCacheMaxItems"; |
| 422 |
pub const cPRIV_KEY_CACHE_MAX_ITEMS_DEFAULT: DWORD = 20; |
| 423 |
pub const szPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS: &'static str |
| 424 |
= "PrivKeyCachePurgeIntervalSeconds"; |
| 425 |
pub const cPRIV_KEY_CACHE_PURGE_INTERVAL_SECONDS_DEFAULT: DWORD = 86400; |
| 426 |
pub const CUR_BLOB_VERSION: DWORD = 2; |
| 427 |
STRUCT!{struct CMS_KEY_INFO { |
| 428 |
dwVersion: DWORD, |
| 429 |
Algid: ALG_ID, |
| 430 |
pbOID: *mut BYTE, |
| 431 |
cbOID: DWORD, |
| 432 |
}} |
| 433 |
pub type PCMS_KEY_INFO = *mut CMS_KEY_INFO; |
| 434 |
STRUCT!{struct HMAC_INFO { |
| 435 |
HashAlgid: ALG_ID, |
| 436 |
pbInnerString: *mut BYTE, |
| 437 |
cbInnerString: DWORD, |
| 438 |
pbOuterString: *mut BYTE, |
| 439 |
cbOuterString: DWORD, |
| 440 |
}} |
| 441 |
pub type PHMAC_INFO = *mut HMAC_INFO; |
| 442 |
STRUCT!{struct SCHANNEL_ALG { |
| 443 |
dwUse: DWORD, |
| 444 |
Algid: ALG_ID, |
| 445 |
cBits: DWORD, |
| 446 |
dwFlags: DWORD, |
| 447 |
dwReserved: DWORD, |
| 448 |
}} |
| 449 |
pub type PSCHANNEL_ALG = *mut SCHANNEL_ALG; |
| 450 |
pub const SCHANNEL_MAC_KEY: DWORD = 0x00000000; |
| 451 |
pub const SCHANNEL_ENC_KEY: DWORD = 0x00000001; |
| 452 |
pub const INTERNATIONAL_USAGE: DWORD = 0x00000001; |
| 453 |
STRUCT!{struct PROV_ENUMALGS { |
| 454 |
aiAlgid: ALG_ID, |
| 455 |
dwBitLen: DWORD, |
| 456 |
dwNameLen: DWORD, |
| 457 |
szName: [CHAR; 20], |
| 458 |
}} |
| 459 |
STRUCT!{struct PROV_ENUMALGS_EX { |
| 460 |
aiAlgid: ALG_ID, |
| 461 |
dwDefaultLen: DWORD, |
| 462 |
dwMinLen: DWORD, |
| 463 |
dwMaxLen: DWORD, |
| 464 |
dwProtocols: DWORD, |
| 465 |
dwNameLen: DWORD, |
| 466 |
szName: [CHAR; 20], |
| 467 |
dwLongNameLen: DWORD, |
| 468 |
szLongName: [CHAR; 40], |
| 469 |
}} |
| 470 |
STRUCT!{struct BLOBHEADER { |
| 471 |
bType: BYTE, |
| 472 |
bVersion: BYTE, |
| 473 |
reserved: WORD, |
| 474 |
aiKeyAlg: ALG_ID, |
| 475 |
}} |
| 476 |
pub type PUBLICKEYSTRUC = BLOBHEADER; |
| 477 |
STRUCT!{struct RSAPUBKEY { |
| 478 |
magic: DWORD, |
| 479 |
bitlen: DWORD, |
| 480 |
pubexp: DWORD, |
| 481 |
}} |
| 482 |
STRUCT!{struct DHPUBKEY { |
| 483 |
magic: DWORD, |
| 484 |
bitlen: DWORD, |
| 485 |
}} |
| 486 |
pub type DSSPUBKEY = DHPUBKEY; |
| 487 |
pub type KEAPUBKEY = DHPUBKEY; |
| 488 |
pub type TEKPUBKEY = DHPUBKEY; |
| 489 |
STRUCT!{struct DSSSEED { |
| 490 |
counter: DWORD, |
| 491 |
seed: [BYTE; 20], |
| 492 |
}} |
| 493 |
STRUCT!{struct DHPUBKEY_VER3 { |
| 494 |
magic: DWORD, |
| 495 |
bitlenP: DWORD, |
| 496 |
bitlenQ: DWORD, |
| 497 |
bitlenJ: DWORD, |
| 498 |
DSSSeed: DSSSEED, |
| 499 |
}} |
| 500 |
pub type DSSPUBKEY_VER3 = DHPUBKEY_VER3; |
| 501 |
STRUCT!{struct DHPRIVKEY_VER3 { |
| 502 |
magic: DWORD, |
| 503 |
bitlenP: DWORD, |
| 504 |
bitlenQ: DWORD, |
| 505 |
bitlenJ: DWORD, |
| 506 |
bitlenX: DWORD, |
| 507 |
DSSSeed: DSSSEED, |
| 508 |
}} |
| 509 |
pub type DSSPRIVKEY_VER3 = DHPRIVKEY_VER3; |
| 510 |
STRUCT!{struct KEY_TYPE_SUBTYPE { |
| 511 |
dwKeySpec: DWORD, |
| 512 |
Type: GUID, |
| 513 |
Subtype: GUID, |
| 514 |
}} |
| 515 |
pub type PKEY_TYPE_SUBTYPE = *mut KEY_TYPE_SUBTYPE; |
| 516 |
STRUCT!{struct CERT_FORTEZZA_DATA_PROP { |
| 517 |
SerialNumber: [c_uchar; 8], |
| 518 |
CertIndex: c_int, |
| 519 |
CertLabel: [c_uchar; 36], |
| 520 |
}} |
| 521 |
STRUCT!{struct CRYPT_RC4_KEY_STATE { |
| 522 |
Key: [c_uchar; 16], |
| 523 |
SBox: [c_uchar; 256], |
| 524 |
i: c_uchar, |
| 525 |
j: c_uchar, |
| 526 |
}} |
| 527 |
pub type PCRYPT_RC4_KEY_STATE = *mut CRYPT_RC4_KEY_STATE; |
| 528 |
STRUCT!{struct CRYPT_DES_KEY_STATE { |
| 529 |
Key: [c_uchar; 8], |
| 530 |
IV: [c_uchar; 8], |
| 531 |
Feedback: [c_uchar; 8], |
| 532 |
}} |
| 533 |
pub type PCRYPT_DES_KEY_STATE = *mut CRYPT_DES_KEY_STATE; |
| 534 |
STRUCT!{struct CRYPT_3DES_KEY_STATE { |
| 535 |
Key: [c_uchar; 24], |
| 536 |
IV: [c_uchar; 8], |
| 537 |
Feedback: [c_uchar; 8], |
| 538 |
}} |
| 539 |
pub type PCRYPT_3DES_KEY_STATE = *mut CRYPT_3DES_KEY_STATE; |
| 540 |
STRUCT!{struct CRYPT_AES_128_KEY_STATE { |
| 541 |
Key: [c_uchar; 16], |
| 542 |
IV: [c_uchar; 16], |
| 543 |
EncryptionState: [[c_uchar; 16]; 11], |
| 544 |
DecryptionState: [[c_uchar; 16]; 11], |
| 545 |
Feedback: [c_uchar; 16], |
| 546 |
}} |
| 547 |
pub type PCRYPT_AES_128_KEY_STATE = *mut CRYPT_AES_128_KEY_STATE; |
| 548 |
STRUCT!{struct CRYPT_AES_256_KEY_STATE { |
| 549 |
Key: [c_uchar; 32], |
| 550 |
IV: [c_uchar; 16], |
| 551 |
EncryptionState: [[c_uchar; 16]; 15], |
| 552 |
DecryptionState: [[c_uchar; 16]; 15], |
| 553 |
Feedback: [c_uchar; 16], |
| 554 |
}} |
| 555 |
pub type PCRYPT_AES_256_KEY_STATE = *mut CRYPT_AES_256_KEY_STATE; |
| 556 |
STRUCT!{struct CRYPTOAPI_BLOB { |
| 557 |
cbData: DWORD, |
| 558 |
pbData: *mut BYTE, |
| 559 |
}} |
| 560 |
pub type CRYPT_INTEGER_BLOB = CRYPTOAPI_BLOB; |
| 561 |
pub type PCRYPT_INTEGER_BLOB = *mut CRYPTOAPI_BLOB; |
| 562 |
pub type CRYPT_UINT_BLOB = CRYPTOAPI_BLOB; |
| 563 |
pub type PCRYPT_UINT_BLOB = *mut CRYPTOAPI_BLOB; |
| 564 |
pub type CRYPT_OBJID_BLOB = CRYPTOAPI_BLOB; |
| 565 |
pub type PCRYPT_OBJID_BLOB = *mut CRYPTOAPI_BLOB; |
| 566 |
pub type CERT_NAME_BLOB = CRYPTOAPI_BLOB; |
| 567 |
pub type PCERT_NAME_BLOB = *mut CRYPTOAPI_BLOB; |
| 568 |
pub type CERT_RDN_VALUE_BLOB = CRYPTOAPI_BLOB; |
| 569 |
pub type PCERT_RDN_VALUE_BLOB = *mut CRYPTOAPI_BLOB; |
| 570 |
pub type CERT_BLOB = CRYPTOAPI_BLOB; |
| 571 |
pub type PCERT_BLOB = *mut CRYPTOAPI_BLOB; |
| 572 |
pub type CRL_BLOB = CRYPTOAPI_BLOB; |
| 573 |
pub type PCRL_BLOB = *mut CRYPTOAPI_BLOB; |
| 574 |
pub type DATA_BLOB = CRYPTOAPI_BLOB; |
| 575 |
pub type PDATA_BLOB = *mut CRYPTOAPI_BLOB; |
| 576 |
pub type CRYPT_DATA_BLOB = CRYPTOAPI_BLOB; |
| 577 |
pub type PCRYPT_DATA_BLOB = *mut CRYPTOAPI_BLOB; |
| 578 |
pub type CRYPT_HASH_BLOB = CRYPTOAPI_BLOB; |
| 579 |
pub type PCRYPT_HASH_BLOB = *mut CRYPTOAPI_BLOB; |
| 580 |
pub type CRYPT_DIGEST_BLOB = CRYPTOAPI_BLOB; |
| 581 |
pub type PCRYPT_DIGEST_BLOB = *mut CRYPTOAPI_BLOB; |
| 582 |
pub type CRYPT_DER_BLOB = CRYPTOAPI_BLOB; |
| 583 |
pub type PCRYPT_DER_BLOB = *mut CRYPTOAPI_BLOB; |
| 584 |
pub type CRYPT_ATTR_BLOB = CRYPTOAPI_BLOB; |
| 585 |
pub type PCRYPT_ATTR_BLOB = *mut CRYPTOAPI_BLOB; |
| 586 |
STRUCT!{struct CMS_DH_KEY_INFO { |
| 587 |
dwVersion: DWORD, |
| 588 |
Algid: ALG_ID, |
| 589 |
pszContentEncObjId: LPSTR, |
| 590 |
PubInfo: CRYPT_DATA_BLOB, |
| 591 |
pReserved: *mut c_void, |
| 592 |
}} |
| 593 |
pub type PCMS_DH_KEY_INFO = *mut CMS_DH_KEY_INFO; |
| 594 |
extern "system" { |
| 595 |
pub fn CryptAcquireContextA( |
| 596 |
phProv: *mut HCRYPTPROV, |
| 597 |
szContainer: LPCSTR, |
| 598 |
szProvider: LPCSTR, |
| 599 |
dwProvType: DWORD, |
| 600 |
dwFlags: DWORD, |
| 601 |
) -> BOOL; |
| 602 |
pub fn CryptAcquireContextW( |
| 603 |
phProv: *mut HCRYPTPROV, |
| 604 |
szContainer: LPCWSTR, |
| 605 |
szProvider: LPCWSTR, |
| 606 |
dwProvType: DWORD, |
| 607 |
dwFlags: DWORD, |
| 608 |
) -> BOOL; |
| 609 |
pub fn CryptReleaseContext( |
| 610 |
hProv: HCRYPTPROV, |
| 611 |
dwFlags: DWORD, |
| 612 |
) -> BOOL; |
| 613 |
pub fn CryptGenKey( |
| 614 |
hProv: HCRYPTPROV, |
| 615 |
Algid: ALG_ID, |
| 616 |
dwFlags: DWORD, |
| 617 |
phKey: *mut HCRYPTKEY, |
| 618 |
) -> BOOL; |
| 619 |
pub fn CryptDeriveKey( |
| 620 |
hProv: HCRYPTPROV, |
| 621 |
Algid: ALG_ID, |
| 622 |
hBaseData: HCRYPTHASH, |
| 623 |
dwFlags: DWORD, |
| 624 |
phKey: *mut HCRYPTKEY, |
| 625 |
) -> BOOL; |
| 626 |
pub fn CryptDestroyKey( |
| 627 |
hKey: HCRYPTKEY, |
| 628 |
) -> BOOL; |
| 629 |
pub fn CryptSetKeyParam( |
| 630 |
hKey: HCRYPTKEY, |
| 631 |
dwParam: DWORD, |
| 632 |
pbData: *const BYTE, |
| 633 |
dwFlags: DWORD, |
| 634 |
) -> BOOL; |
| 635 |
pub fn CryptGetKeyParam( |
| 636 |
hKey: HCRYPTKEY, |
| 637 |
dwParam: DWORD, |
| 638 |
pbData: *mut BYTE, |
| 639 |
pdwDataLen: *mut DWORD, |
| 640 |
dwFlags: DWORD, |
| 641 |
) -> BOOL; |
| 642 |
pub fn CryptSetHashParam( |
| 643 |
hHash: HCRYPTHASH, |
| 644 |
dwParam: DWORD, |
| 645 |
pbData: *const BYTE, |
| 646 |
dwFlags: DWORD, |
| 647 |
) -> BOOL; |
| 648 |
pub fn CryptGetHashParam( |
| 649 |
hHash: HCRYPTHASH, |
| 650 |
dwParam: DWORD, |
| 651 |
pbData: *mut BYTE, |
| 652 |
pdwDataLen: *mut DWORD, |
| 653 |
dwFlags: DWORD, |
| 654 |
) -> BOOL; |
| 655 |
pub fn CryptSetProvParam( |
| 656 |
hProv: HCRYPTPROV, |
| 657 |
dwParam: DWORD, |
| 658 |
pbData: *const BYTE, |
| 659 |
dwFlags: DWORD, |
| 660 |
) -> BOOL; |
| 661 |
pub fn CryptGetProvParam( |
| 662 |
hProv: HCRYPTPROV, |
| 663 |
dwParam: DWORD, |
| 664 |
pbData: *mut BYTE, |
| 665 |
pdwDataLen: *mut DWORD, |
| 666 |
dwFlags: DWORD, |
| 667 |
) -> BOOL; |
| 668 |
pub fn CryptGenRandom( |
| 669 |
hProv: HCRYPTPROV, |
| 670 |
dwLen: DWORD, |
| 671 |
pbBuffer: *mut BYTE, |
| 672 |
) -> BOOL; |
| 673 |
pub fn CryptGetUserKey( |
| 674 |
hProv: HCRYPTPROV, |
| 675 |
dwKeySpec: DWORD, |
| 676 |
phUserKey: *mut HCRYPTKEY, |
| 677 |
) -> BOOL; |
| 678 |
pub fn CryptExportKey( |
| 679 |
hKey: HCRYPTKEY, |
| 680 |
hExpKey: HCRYPTKEY, |
| 681 |
dwBlobType: DWORD, |
| 682 |
dwFlags: DWORD, |
| 683 |
pbData: *mut BYTE, |
| 684 |
pdwDataLen: *mut DWORD, |
| 685 |
) -> BOOL; |
| 686 |
pub fn CryptImportKey( |
| 687 |
hProv: HCRYPTPROV, |
| 688 |
pbData: *const BYTE, |
| 689 |
dwDataLen: DWORD, |
| 690 |
hPubKey: HCRYPTKEY, |
| 691 |
dwFlags: DWORD, |
| 692 |
phKey: *mut HCRYPTKEY, |
| 693 |
) -> BOOL; |
| 694 |
pub fn CryptEncrypt( |
| 695 |
hKey: HCRYPTKEY, |
| 696 |
hHash: HCRYPTHASH, |
| 697 |
Final: BOOL, |
| 698 |
dwFlags: DWORD, |
| 699 |
pbData: *mut BYTE, |
| 700 |
pdwDataLen: *mut DWORD, |
| 701 |
dwBufLen: DWORD, |
| 702 |
) -> BOOL; |
| 703 |
pub fn CryptDecrypt( |
| 704 |
hKey: HCRYPTKEY, |
| 705 |
hHash: HCRYPTHASH, |
| 706 |
Final: BOOL, |
| 707 |
dwFlags: DWORD, |
| 708 |
pbData: *mut BYTE, |
| 709 |
pdwDataLen: *mut DWORD, |
| 710 |
) -> BOOL; |
| 711 |
pub fn CryptCreateHash( |
| 712 |
hProv: HCRYPTPROV, |
| 713 |
Algid: ALG_ID, |
| 714 |
hKey: HCRYPTKEY, |
| 715 |
dwFlags: DWORD, |
| 716 |
phHash: *mut HCRYPTHASH, |
| 717 |
) -> BOOL; |
| 718 |
pub fn CryptHashData( |
| 719 |
hHash: HCRYPTHASH, |
| 720 |
pbData: *const BYTE, |
| 721 |
dwDataLen: DWORD, |
| 722 |
dwFlags: DWORD, |
| 723 |
) -> BOOL; |
| 724 |
pub fn CryptHashSessionKey( |
| 725 |
hHash: HCRYPTHASH, |
| 726 |
hKey: HCRYPTKEY, |
| 727 |
dwFlags: DWORD, |
| 728 |
) -> BOOL; |
| 729 |
pub fn CryptDestroyHash( |
| 730 |
hHash: HCRYPTHASH, |
| 731 |
) -> BOOL; |
| 732 |
pub fn CryptSignHashA( |
| 733 |
hHash: HCRYPTHASH, |
| 734 |
dwKeySpec: DWORD, |
| 735 |
szDescription: LPCSTR, |
| 736 |
dwFlags: DWORD, |
| 737 |
pbSignature: *mut BYTE, |
| 738 |
pdwSigLen: *mut DWORD, |
| 739 |
) -> BOOL; |
| 740 |
pub fn CryptSignHashW( |
| 741 |
hHash: HCRYPTHASH, |
| 742 |
dwKeySpec: DWORD, |
| 743 |
szDescription: LPCWSTR, |
| 744 |
dwFlags: DWORD, |
| 745 |
pbSignature: *mut BYTE, |
| 746 |
pdwSigLen: *mut DWORD, |
| 747 |
) -> BOOL; |
| 748 |
pub fn CryptVerifySignatureA( |
| 749 |
hHash: HCRYPTHASH, |
| 750 |
pbSignature: *const BYTE, |
| 751 |
dwSigLen: DWORD, |
| 752 |
hPubKey: HCRYPTKEY, |
| 753 |
szDescription: LPCSTR, |
| 754 |
dwFlags: DWORD, |
| 755 |
) -> BOOL; |
| 756 |
pub fn CryptVerifySignatureW( |
| 757 |
hHash: HCRYPTHASH, |
| 758 |
pbSignature: *const BYTE, |
| 759 |
dwSigLen: DWORD, |
| 760 |
hPubKey: HCRYPTKEY, |
| 761 |
szDescription: LPCWSTR, |
| 762 |
dwFlags: DWORD, |
| 763 |
) -> BOOL; |
| 764 |
pub fn CryptSetProviderA( |
| 765 |
pszProvName: LPCSTR, |
| 766 |
dwProvType: DWORD, |
| 767 |
) -> BOOL; |
| 768 |
pub fn CryptSetProviderW( |
| 769 |
pszProvName: LPCWSTR, |
| 770 |
dwProvType: DWORD, |
| 771 |
) -> BOOL; |
| 772 |
pub fn CryptSetProviderExA( |
| 773 |
pszProvName: LPCSTR, |
| 774 |
dwProvType: DWORD, |
| 775 |
pdwReserved: *mut DWORD, |
| 776 |
dwFlags: DWORD, |
| 777 |
) -> BOOL; |
| 778 |
pub fn CryptSetProviderExW( |
| 779 |
pszProvName: LPCWSTR, |
| 780 |
dwProvType: DWORD, |
| 781 |
pdwReserved: *mut DWORD, |
| 782 |
dwFlags: DWORD, |
| 783 |
) -> BOOL; |
| 784 |
pub fn CryptGetDefaultProviderA( |
| 785 |
dwProvType: DWORD, |
| 786 |
pdwReserved: *mut DWORD, |
| 787 |
dwFlags: DWORD, |
| 788 |
pszProvName: LPSTR, |
| 789 |
pcbProvName: *mut DWORD, |
| 790 |
) -> BOOL; |
| 791 |
pub fn CryptGetDefaultProviderW( |
| 792 |
dwProvType: DWORD, |
| 793 |
pdwReserved: *mut DWORD, |
| 794 |
dwFlags: DWORD, |
| 795 |
pszProvName: LPWSTR, |
| 796 |
pcbProvName: *mut DWORD, |
| 797 |
) -> BOOL; |
| 798 |
pub fn CryptEnumProviderTypesA( |
| 799 |
dwIndex: DWORD, |
| 800 |
pdwReserved: *mut DWORD, |
| 801 |
dwFlags: DWORD, |
| 802 |
pdwProvType: *mut DWORD, |
| 803 |
szTypeName: LPSTR, |
| 804 |
pcbTypeName: *mut DWORD, |
| 805 |
) -> BOOL; |
| 806 |
pub fn CryptEnumProviderTypesW( |
| 807 |
dwIndex: DWORD, |
| 808 |
pdwReserved: *mut DWORD, |
| 809 |
dwFlags: DWORD, |
| 810 |
pdwProvType: *mut DWORD, |
| 811 |
szTypeName: LPWSTR, |
| 812 |
pcbTypeName: *mut DWORD, |
| 813 |
) -> BOOL; |
| 814 |
pub fn CryptEnumProvidersA( |
| 815 |
dwIndex: DWORD, |
| 816 |
pdwReserved: *mut DWORD, |
| 817 |
dwFlags: DWORD, |
| 818 |
pdwProvType: *mut DWORD, |
| 819 |
szProvName: LPSTR, |
| 820 |
pcbProvName: *mut DWORD, |
| 821 |
) -> BOOL; |
| 822 |
pub fn CryptEnumProvidersW( |
| 823 |
dwIndex: DWORD, |
| 824 |
pdwReserved: *mut DWORD, |
| 825 |
dwFlags: DWORD, |
| 826 |
pdwProvType: *mut DWORD, |
| 827 |
szProvName: LPWSTR, |
| 828 |
pcbProvName: *mut DWORD, |
| 829 |
) -> BOOL; |
| 830 |
pub fn CryptContextAddRef( |
| 831 |
hProv: HCRYPTPROV, |
| 832 |
pdwReserved: *mut DWORD, |
| 833 |
dwFlags: DWORD, |
| 834 |
) -> BOOL; |
| 835 |
pub fn CryptDuplicateKey( |
| 836 |
hKey: HCRYPTKEY, |
| 837 |
pdwReserved: *mut DWORD, |
| 838 |
dwFlags: DWORD, |
| 839 |
phKey: *mut HCRYPTKEY, |
| 840 |
) -> BOOL; |
| 841 |
pub fn CryptDuplicateHash( |
| 842 |
hHash: HCRYPTHASH, |
| 843 |
pdwReserved: *mut DWORD, |
| 844 |
dwFlags: DWORD, |
| 845 |
phHash: *mut HCRYPTHASH, |
| 846 |
) -> BOOL; |
| 847 |
} |
| 848 |
extern "C" { |
| 849 |
pub fn GetEncSChannel( |
| 850 |
pData: *mut *mut BYTE, |
| 851 |
dwDecSize: *mut DWORD, |
| 852 |
) -> BOOL; |
| 853 |
} |
| 854 |
pub type HCRYPTPROV_OR_NCRYPT_KEY_HANDLE = ULONG_PTR; |
| 855 |
pub type HCRYPTPROV_LEGACY = ULONG_PTR; |
| 856 |
STRUCT!{struct CRYPT_BIT_BLOB { |
| 857 |
cbData: DWORD, |
| 858 |
pbData: *mut BYTE, |
| 859 |
cUnusedBits: DWORD, |
| 860 |
}} |
| 861 |
pub type PCRYPT_BIT_BLOB = *mut CRYPT_BIT_BLOB; |
| 862 |
STRUCT!{struct CRYPT_ALGORITHM_IDENTIFIER { |
| 863 |
pszObjId: LPSTR, |
| 864 |
Parameters: CRYPT_OBJID_BLOB, |
| 865 |
}} |
| 866 |
pub type PCRYPT_ALGORITHM_IDENTIFIER = *mut CRYPT_ALGORITHM_IDENTIFIER; |
| 867 |
pub const szOID_RSA: &'static str = "1.2.840.113549"; |
| 868 |
pub const szOID_PKCS: &'static str = "1.2.840.113549.1"; |
| 869 |
pub const szOID_RSA_HASH: &'static str = "1.2.840.113549.2"; |
| 870 |
pub const szOID_RSA_ENCRYPT: &'static str = "1.2.840.113549.3"; |
| 871 |
pub const szOID_PKCS_1: &'static str = "1.2.840.113549.1.1"; |
| 872 |
pub const szOID_PKCS_2: &'static str = "1.2.840.113549.1.2"; |
| 873 |
pub const szOID_PKCS_3: &'static str = "1.2.840.113549.1.3"; |
| 874 |
pub const szOID_PKCS_4: &'static str = "1.2.840.113549.1.4"; |
| 875 |
pub const szOID_PKCS_5: &'static str = "1.2.840.113549.1.5"; |
| 876 |
pub const szOID_PKCS_6: &'static str = "1.2.840.113549.1.6"; |
| 877 |
pub const szOID_PKCS_7: &'static str = "1.2.840.113549.1.7"; |
| 878 |
pub const szOID_PKCS_8: &'static str = "1.2.840.113549.1.8"; |
| 879 |
pub const szOID_PKCS_9: &'static str = "1.2.840.113549.1.9"; |
| 880 |
pub const szOID_PKCS_10: &'static str = "1.2.840.113549.1.10"; |
| 881 |
pub const szOID_PKCS_12: &'static str = "1.2.840.113549.1.12"; |
| 882 |
pub const szOID_RSA_RSA: &'static str = "1.2.840.113549.1.1.1"; |
| 883 |
pub const szOID_RSA_MD2RSA: &'static str = "1.2.840.113549.1.1.2"; |
| 884 |
pub const szOID_RSA_MD4RSA: &'static str = "1.2.840.113549.1.1.3"; |
| 885 |
pub const szOID_RSA_MD5RSA: &'static str = "1.2.840.113549.1.1.4"; |
| 886 |
pub const szOID_RSA_SHA1RSA: &'static str = "1.2.840.113549.1.1.5"; |
| 887 |
pub const szOID_RSA_SETOAEP_RSA: &'static str = "1.2.840.113549.1.1.6"; |
| 888 |
pub const szOID_RSAES_OAEP: &'static str = "1.2.840.113549.1.1.7"; |
| 889 |
pub const szOID_RSA_MGF1: &'static str = "1.2.840.113549.1.1.8"; |
| 890 |
pub const szOID_RSA_PSPECIFIED: &'static str = "1.2.840.113549.1.1.9"; |
| 891 |
pub const szOID_RSA_SSA_PSS: &'static str = "1.2.840.113549.1.1.10"; |
| 892 |
pub const szOID_RSA_SHA256RSA: &'static str = "1.2.840.113549.1.1.11"; |
| 893 |
pub const szOID_RSA_SHA384RSA: &'static str = "1.2.840.113549.1.1.12"; |
| 894 |
pub const szOID_RSA_SHA512RSA: &'static str = "1.2.840.113549.1.1.13"; |
| 895 |
pub const szOID_RSA_DH: &'static str = "1.2.840.113549.1.3.1"; |
| 896 |
pub const szOID_RSA_data: &'static str = "1.2.840.113549.1.7.1"; |
| 897 |
pub const szOID_RSA_signedData: &'static str = "1.2.840.113549.1.7.2"; |
| 898 |
pub const szOID_RSA_envelopedData: &'static str = "1.2.840.113549.1.7.3"; |
| 899 |
pub const szOID_RSA_signEnvData: &'static str = "1.2.840.113549.1.7.4"; |
| 900 |
pub const szOID_RSA_digestedData: &'static str = "1.2.840.113549.1.7.5"; |
| 901 |
pub const szOID_RSA_hashedData: &'static str = "1.2.840.113549.1.7.5"; |
| 902 |
pub const szOID_RSA_encryptedData: &'static str = "1.2.840.113549.1.7.6"; |
| 903 |
pub const szOID_RSA_emailAddr: &'static str = "1.2.840.113549.1.9.1"; |
| 904 |
pub const szOID_RSA_unstructName: &'static str = "1.2.840.113549.1.9.2"; |
| 905 |
pub const szOID_RSA_contentType: &'static str = "1.2.840.113549.1.9.3"; |
| 906 |
pub const szOID_RSA_messageDigest: &'static str = "1.2.840.113549.1.9.4"; |
| 907 |
pub const szOID_RSA_signingTime: &'static str = "1.2.840.113549.1.9.5"; |
| 908 |
pub const szOID_RSA_counterSign: &'static str = "1.2.840.113549.1.9.6"; |
| 909 |
pub const szOID_RSA_challengePwd: &'static str = "1.2.840.113549.1.9.7"; |
| 910 |
pub const szOID_RSA_unstructAddr: &'static str = "1.2.840.113549.1.9.8"; |
| 911 |
pub const szOID_RSA_extCertAttrs: &'static str = "1.2.840.113549.1.9.9"; |
| 912 |
pub const szOID_RSA_certExtensions: &'static str = "1.2.840.113549.1.9.14"; |
| 913 |
pub const szOID_RSA_SMIMECapabilities: &'static str = "1.2.840.113549.1.9.15"; |
| 914 |
pub const szOID_RSA_preferSignedData: &'static str = "1.2.840.113549.1.9.15.1"; |
| 915 |
pub const szOID_TIMESTAMP_TOKEN: &'static str = "1.2.840.113549.1.9.16.1.4"; |
| 916 |
pub const szOID_RFC3161_counterSign: &'static str = "1.3.6.1.4.1.311.3.3.1"; |
| 917 |
pub const szOID_RSA_SMIMEalg: &'static str = "1.2.840.113549.1.9.16.3"; |
| 918 |
pub const szOID_RSA_SMIMEalgESDH: &'static str = "1.2.840.113549.1.9.16.3.5"; |
| 919 |
pub const szOID_RSA_SMIMEalgCMS3DESwrap: &'static str = "1.2.840.113549.1.9.16.3.6"; |
| 920 |
pub const szOID_RSA_SMIMEalgCMSRC2wrap: &'static str = "1.2.840.113549.1.9.16.3.7"; |
| 921 |
pub const szOID_RSA_MD2: &'static str = "1.2.840.113549.2.2"; |
| 922 |
pub const szOID_RSA_MD4: &'static str = "1.2.840.113549.2.4"; |
| 923 |
pub const szOID_RSA_MD5: &'static str = "1.2.840.113549.2.5"; |
| 924 |
pub const szOID_RSA_RC2CBC: &'static str = "1.2.840.113549.3.2"; |
| 925 |
pub const szOID_RSA_RC4: &'static str = "1.2.840.113549.3.4"; |
| 926 |
pub const szOID_RSA_DES_EDE3_CBC: &'static str = "1.2.840.113549.3.7"; |
| 927 |
pub const szOID_RSA_RC5_CBCPad: &'static str = "1.2.840.113549.3.9"; |
| 928 |
pub const szOID_ANSI_X942: &'static str = "1.2.840.10046"; |
| 929 |
pub const szOID_ANSI_X942_DH: &'static str = "1.2.840.10046.2.1"; |
| 930 |
pub const szOID_X957: &'static str = "1.2.840.10040"; |
| 931 |
pub const szOID_X957_DSA: &'static str = "1.2.840.10040.4.1"; |
| 932 |
pub const szOID_X957_SHA1DSA: &'static str = "1.2.840.10040.4.3"; |
| 933 |
pub const szOID_ECC_PUBLIC_KEY: &'static str = "1.2.840.10045.2.1"; |
| 934 |
pub const szOID_ECC_CURVE_P256: &'static str = "1.2.840.10045.3.1.7"; |
| 935 |
pub const szOID_ECC_CURVE_P384: &'static str = "1.3.132.0.34"; |
| 936 |
pub const szOID_ECC_CURVE_P521: &'static str = "1.3.132.0.35"; |
| 937 |
pub const szOID_ECC_CURVE_BRAINPOOLP160R1: &'static str = "1.3.36.3.3.2.8.1.1.1"; |
| 938 |
pub const szOID_ECC_CURVE_BRAINPOOLP160T1: &'static str = "1.3.36.3.3.2.8.1.1.2"; |
| 939 |
pub const szOID_ECC_CURVE_BRAINPOOLP192R1: &'static str = "1.3.36.3.3.2.8.1.1.3"; |
| 940 |
pub const szOID_ECC_CURVE_BRAINPOOLP192T1: &'static str = "1.3.36.3.3.2.8.1.1.4"; |
| 941 |
pub const szOID_ECC_CURVE_BRAINPOOLP224R1: &'static str = "1.3.36.3.3.2.8.1.1.5"; |
| 942 |
pub const szOID_ECC_CURVE_BRAINPOOLP224T1: &'static str = "1.3.36.3.3.2.8.1.1.6"; |
| 943 |
pub const szOID_ECC_CURVE_BRAINPOOLP256R1: &'static str = "1.3.36.3.3.2.8.1.1.7"; |
| 944 |
pub const szOID_ECC_CURVE_BRAINPOOLP256T1: &'static str = "1.3.36.3.3.2.8.1.1.8"; |
| 945 |
pub const szOID_ECC_CURVE_BRAINPOOLP320R1: &'static str = "1.3.36.3.3.2.8.1.1.9"; |
| 946 |
pub const szOID_ECC_CURVE_BRAINPOOLP320T1: &'static str = "1.3.36.3.3.2.8.1.1.10"; |
| 947 |
pub const szOID_ECC_CURVE_BRAINPOOLP384R1: &'static str = "1.3.36.3.3.2.8.1.1.11"; |
| 948 |
pub const szOID_ECC_CURVE_BRAINPOOLP384T1: &'static str = "1.3.36.3.3.2.8.1.1.12"; |
| 949 |
pub const szOID_ECC_CURVE_BRAINPOOLP512R1: &'static str = "1.3.36.3.3.2.8.1.1.13"; |
| 950 |
pub const szOID_ECC_CURVE_BRAINPOOLP512T1: &'static str = "1.3.36.3.3.2.8.1.1.14"; |
| 951 |
pub const szOID_ECC_CURVE_EC192WAPI: &'static str = "1.2.156.11235.1.1.2.1"; |
| 952 |
pub const szOID_CN_ECDSA_SHA256: &'static str = "1.2.156.11235.1.1.1"; |
| 953 |
pub const szOID_ECC_CURVE_NISTP192: &'static str = "1.2.840.10045.3.1.1"; |
| 954 |
pub const szOID_ECC_CURVE_NISTP224: &'static str = "1.3.132.0.33"; |
| 955 |
pub const szOID_ECC_CURVE_NISTP256: &'static str = szOID_ECC_CURVE_P256; |
| 956 |
pub const szOID_ECC_CURVE_NISTP384: &'static str = szOID_ECC_CURVE_P384; |
| 957 |
pub const szOID_ECC_CURVE_NISTP521: &'static str = szOID_ECC_CURVE_P521; |
| 958 |
pub const szOID_ECC_CURVE_SECP160K1: &'static str = "1.3.132.0.9"; |
| 959 |
pub const szOID_ECC_CURVE_SECP160R1: &'static str = "1.3.132.0.8"; |
| 960 |
pub const szOID_ECC_CURVE_SECP160R2: &'static str = "1.3.132.0.30"; |
| 961 |
pub const szOID_ECC_CURVE_SECP192K1: &'static str = "1.3.132.0.31"; |
| 962 |
pub const szOID_ECC_CURVE_SECP192R1: &'static str = szOID_ECC_CURVE_NISTP192; |
| 963 |
pub const szOID_ECC_CURVE_SECP224K1: &'static str = "1.3.132.0.32"; |
| 964 |
pub const szOID_ECC_CURVE_SECP224R1: &'static str = szOID_ECC_CURVE_NISTP224; |
| 965 |
pub const szOID_ECC_CURVE_SECP256K1: &'static str = "1.3.132.0.10"; |
| 966 |
pub const szOID_ECC_CURVE_SECP256R1: &'static str = szOID_ECC_CURVE_P256; |
| 967 |
pub const szOID_ECC_CURVE_SECP384R1: &'static str = szOID_ECC_CURVE_P384; |
| 968 |
pub const szOID_ECC_CURVE_SECP521R1: &'static str = szOID_ECC_CURVE_P521; |
| 969 |
pub const szOID_ECC_CURVE_WTLS7: &'static str = szOID_ECC_CURVE_SECP160R2; |
| 970 |
pub const szOID_ECC_CURVE_WTLS9: &'static str = "2.23.43.1.4.9"; |
| 971 |
pub const szOID_ECC_CURVE_WTLS12: &'static str = szOID_ECC_CURVE_NISTP224; |
| 972 |
pub const szOID_ECC_CURVE_X962P192V1: &'static str = "1.2.840.10045.3.1.1"; |
| 973 |
pub const szOID_ECC_CURVE_X962P192V2: &'static str = "1.2.840.10045.3.1.2"; |
| 974 |
pub const szOID_ECC_CURVE_X962P192V3: &'static str = "1.2.840.10045.3.1.3"; |
| 975 |
pub const szOID_ECC_CURVE_X962P239V1: &'static str = "1.2.840.10045.3.1.4"; |
| 976 |
pub const szOID_ECC_CURVE_X962P239V2: &'static str = "1.2.840.10045.3.1.5"; |
| 977 |
pub const szOID_ECC_CURVE_X962P239V3: &'static str = "1.2.840.10045.3.1.6"; |
| 978 |
pub const szOID_ECC_CURVE_X962P256V1: &'static str = szOID_ECC_CURVE_P256; |
| 979 |
pub const szOID_ECDSA_SHA1: &'static str = "1.2.840.10045.4.1"; |
| 980 |
pub const szOID_ECDSA_SPECIFIED: &'static str = "1.2.840.10045.4.3"; |
| 981 |
pub const szOID_ECDSA_SHA256: &'static str = "1.2.840.10045.4.3.2"; |
| 982 |
pub const szOID_ECDSA_SHA384: &'static str = "1.2.840.10045.4.3.3"; |
| 983 |
pub const szOID_ECDSA_SHA512: &'static str = "1.2.840.10045.4.3.4"; |
| 984 |
pub const szOID_NIST_AES128_CBC: &'static str = "2.16.840.1.101.3.4.1.2"; |
| 985 |
pub const szOID_NIST_AES192_CBC: &'static str = "2.16.840.1.101.3.4.1.22"; |
| 986 |
pub const szOID_NIST_AES256_CBC: &'static str = "2.16.840.1.101.3.4.1.42"; |
| 987 |
pub const szOID_NIST_AES128_WRAP: &'static str = "2.16.840.1.101.3.4.1.5"; |
| 988 |
pub const szOID_NIST_AES192_WRAP: &'static str = "2.16.840.1.101.3.4.1.25"; |
| 989 |
pub const szOID_NIST_AES256_WRAP: &'static str = "2.16.840.1.101.3.4.1.45"; |
| 990 |
pub const szOID_DH_SINGLE_PASS_STDDH_SHA1_KDF: &'static str = "1.3.133.16.840.63.0.2"; |
| 991 |
pub const szOID_DH_SINGLE_PASS_STDDH_SHA256_KDF: &'static str = "1.3.132.1.11.1"; |
| 992 |
pub const szOID_DH_SINGLE_PASS_STDDH_SHA384_KDF: &'static str = "1.3.132.1.11.2"; |
| 993 |
pub const szOID_DS: &'static str = "2.5"; |
| 994 |
pub const szOID_DSALG: &'static str = "2.5.8"; |
| 995 |
pub const szOID_DSALG_CRPT: &'static str = "2.5.8.1"; |
| 996 |
pub const szOID_DSALG_HASH: &'static str = "2.5.8.2"; |
| 997 |
pub const szOID_DSALG_SIGN: &'static str = "2.5.8.3"; |
| 998 |
pub const szOID_DSALG_RSA: &'static str = "2.5.8.1.1"; |
| 999 |
pub const szOID_OIW: &'static str = "1.3.14"; |
| 1000 |
pub const szOID_OIWSEC: &'static str = "1.3.14.3.2"; |
| 1001 |
pub const szOID_OIWSEC_md4RSA: &'static str = "1.3.14.3.2.2"; |
| 1002 |
pub const szOID_OIWSEC_md5RSA: &'static str = "1.3.14.3.2.3"; |
| 1003 |
pub const szOID_OIWSEC_md4RSA2: &'static str = "1.3.14.3.2.4"; |
| 1004 |
pub const szOID_OIWSEC_desECB: &'static str = "1.3.14.3.2.6"; |
| 1005 |
pub const szOID_OIWSEC_desCBC: &'static str = "1.3.14.3.2.7"; |
| 1006 |
pub const szOID_OIWSEC_desOFB: &'static str = "1.3.14.3.2.8"; |
| 1007 |
pub const szOID_OIWSEC_desCFB: &'static str = "1.3.14.3.2.9"; |
| 1008 |
pub const szOID_OIWSEC_desMAC: &'static str = "1.3.14.3.2.10"; |
| 1009 |
pub const szOID_OIWSEC_rsaSign: &'static str = "1.3.14.3.2.11"; |
| 1010 |
pub const szOID_OIWSEC_dsa: &'static str = "1.3.14.3.2.12"; |
| 1011 |
pub const szOID_OIWSEC_shaDSA: &'static str = "1.3.14.3.2.13"; |
| 1012 |
pub const szOID_OIWSEC_mdc2RSA: &'static str = "1.3.14.3.2.14"; |
| 1013 |
pub const szOID_OIWSEC_shaRSA: &'static str = "1.3.14.3.2.15"; |
| 1014 |
pub const szOID_OIWSEC_dhCommMod: &'static str = "1.3.14.3.2.16"; |
| 1015 |
pub const szOID_OIWSEC_desEDE: &'static str = "1.3.14.3.2.17"; |
| 1016 |
pub const szOID_OIWSEC_sha: &'static str = "1.3.14.3.2.18"; |
| 1017 |
pub const szOID_OIWSEC_mdc2: &'static str = "1.3.14.3.2.19"; |
| 1018 |
pub const szOID_OIWSEC_dsaComm: &'static str = "1.3.14.3.2.20"; |
| 1019 |
pub const szOID_OIWSEC_dsaCommSHA: &'static str = "1.3.14.3.2.21"; |
| 1020 |
pub const szOID_OIWSEC_rsaXchg: &'static str = "1.3.14.3.2.22"; |
| 1021 |
pub const szOID_OIWSEC_keyHashSeal: &'static str = "1.3.14.3.2.23"; |
| 1022 |
pub const szOID_OIWSEC_md2RSASign: &'static str = "1.3.14.3.2.24"; |
| 1023 |
pub const szOID_OIWSEC_md5RSASign: &'static str = "1.3.14.3.2.25"; |
| 1024 |
pub const szOID_OIWSEC_sha1: &'static str = "1.3.14.3.2.26"; |
| 1025 |
pub const szOID_OIWSEC_dsaSHA1: &'static str = "1.3.14.3.2.27"; |
| 1026 |
pub const szOID_OIWSEC_dsaCommSHA1: &'static str = "1.3.14.3.2.28"; |
| 1027 |
pub const szOID_OIWSEC_sha1RSASign: &'static str = "1.3.14.3.2.29"; |
| 1028 |
pub const szOID_OIWDIR: &'static str = "1.3.14.7.2"; |
| 1029 |
pub const szOID_OIWDIR_CRPT: &'static str = "1.3.14.7.2.1"; |
| 1030 |
pub const szOID_OIWDIR_HASH: &'static str = "1.3.14.7.2.2"; |
| 1031 |
pub const szOID_OIWDIR_SIGN: &'static str = "1.3.14.7.2.3"; |
| 1032 |
pub const szOID_OIWDIR_md2: &'static str = "1.3.14.7.2.2.1"; |
| 1033 |
pub const szOID_OIWDIR_md2RSA: &'static str = "1.3.14.7.2.3.1"; |
| 1034 |
pub const szOID_INFOSEC: &'static str = "2.16.840.1.101.2.1"; |
| 1035 |
pub const szOID_INFOSEC_sdnsSignature: &'static str = "2.16.840.1.101.2.1.1.1"; |
| 1036 |
pub const szOID_INFOSEC_mosaicSignature: &'static str = "2.16.840.1.101.2.1.1.2"; |
| 1037 |
pub const szOID_INFOSEC_sdnsConfidentiality: &'static str = "2.16.840.1.101.2.1.1.3"; |
| 1038 |
pub const szOID_INFOSEC_mosaicConfidentiality: &'static str = "2.16.840.1.101.2.1.1.4"; |
| 1039 |
pub const szOID_INFOSEC_sdnsIntegrity: &'static str = "2.16.840.1.101.2.1.1.5"; |
| 1040 |
pub const szOID_INFOSEC_mosaicIntegrity: &'static str = "2.16.840.1.101.2.1.1.6"; |
| 1041 |
pub const szOID_INFOSEC_sdnsTokenProtection: &'static str = "2.16.840.1.101.2.1.1.7"; |
| 1042 |
pub const szOID_INFOSEC_mosaicTokenProtection: &'static str = "2.16.840.1.101.2.1.1.8"; |
| 1043 |
pub const szOID_INFOSEC_sdnsKeyManagement: &'static str = "2.16.840.1.101.2.1.1.9"; |
| 1044 |
pub const szOID_INFOSEC_mosaicKeyManagement: &'static str = "2.16.840.1.101.2.1.1.10"; |
| 1045 |
pub const szOID_INFOSEC_sdnsKMandSig: &'static str = "2.16.840.1.101.2.1.1.11"; |
| 1046 |
pub const szOID_INFOSEC_mosaicKMandSig: &'static str = "2.16.840.1.101.2.1.1.12"; |
| 1047 |
pub const szOID_INFOSEC_SuiteASignature: &'static str = "2.16.840.1.101.2.1.1.13"; |
| 1048 |
pub const szOID_INFOSEC_SuiteAConfidentiality: &'static str = "2.16.840.1.101.2.1.1.14"; |
| 1049 |
pub const szOID_INFOSEC_SuiteAIntegrity: &'static str = "2.16.840.1.101.2.1.1.15"; |
| 1050 |
pub const szOID_INFOSEC_SuiteATokenProtection: &'static str = "2.16.840.1.101.2.1.1.16"; |
| 1051 |
pub const szOID_INFOSEC_SuiteAKeyManagement: &'static str = "2.16.840.1.101.2.1.1.17"; |
| 1052 |
pub const szOID_INFOSEC_SuiteAKMandSig: &'static str = "2.16.840.1.101.2.1.1.18"; |
| 1053 |
pub const szOID_INFOSEC_mosaicUpdatedSig: &'static str = "2.16.840.1.101.2.1.1.19"; |
| 1054 |
pub const szOID_INFOSEC_mosaicKMandUpdSig: &'static str = "2.16.840.1.101.2.1.1.20"; |
| 1055 |
pub const szOID_INFOSEC_mosaicUpdatedInteg: &'static str = "2.16.840.1.101.2.1.1.21"; |
| 1056 |
pub const szOID_NIST_sha256: &'static str = "2.16.840.1.101.3.4.2.1"; |
| 1057 |
pub const szOID_NIST_sha384: &'static str = "2.16.840.1.101.3.4.2.2"; |
| 1058 |
pub const szOID_NIST_sha512: &'static str = "2.16.840.1.101.3.4.2.3"; |
| 1059 |
STRUCT!{struct CRYPT_OBJID_TABLE { |
| 1060 |
dwAlgId: DWORD, |
| 1061 |
pszObjId: LPCSTR, |
| 1062 |
}} |
| 1063 |
pub type PCRYPT_OBJID_TABLE = *mut CRYPT_OBJID_TABLE; |
| 1064 |
STRUCT!{struct CRYPT_HASH_INFO { |
| 1065 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1066 |
Hash: CRYPT_HASH_BLOB, |
| 1067 |
}} |
| 1068 |
pub type PCRYPT_HASH_INFO = *mut CRYPT_HASH_INFO; |
| 1069 |
STRUCT!{struct CERT_EXTENSION { |
| 1070 |
pszObjId: LPSTR, |
| 1071 |
fCritical: BOOL, |
| 1072 |
Value: CRYPT_OBJID_BLOB, |
| 1073 |
}} |
| 1074 |
pub type PCERT_EXTENSION = *mut CERT_EXTENSION; |
| 1075 |
pub type PCCERT_EXTENSION = *const CERT_EXTENSION; |
| 1076 |
STRUCT!{struct CRYPT_ATTRIBUTE_TYPE_VALUE { |
| 1077 |
pszObjId: LPSTR, |
| 1078 |
Value: CRYPT_OBJID_BLOB, |
| 1079 |
}} |
| 1080 |
pub type PCRYPT_ATTRIBUTE_TYPE_VALUE = *mut CRYPT_ATTRIBUTE_TYPE_VALUE; |
| 1081 |
STRUCT!{struct CRYPT_ATTRIBUTE { |
| 1082 |
pszObjId: LPSTR, |
| 1083 |
cValue: DWORD, |
| 1084 |
rgValue: PCRYPT_ATTR_BLOB, |
| 1085 |
}} |
| 1086 |
pub type PCRYPT_ATTRIBUTE = *mut CRYPT_ATTRIBUTE; |
| 1087 |
STRUCT!{struct CRYPT_ATTRIBUTES { |
| 1088 |
cAttr: DWORD, |
| 1089 |
rgAttr: PCRYPT_ATTRIBUTE, |
| 1090 |
}} |
| 1091 |
pub type PCRYPT_ATTRIBUTES = *mut CRYPT_ATTRIBUTES; |
| 1092 |
STRUCT!{struct CERT_RDN_ATTR { |
| 1093 |
pszObjId: LPSTR, |
| 1094 |
dwValueType: DWORD, |
| 1095 |
Value: CERT_RDN_VALUE_BLOB, |
| 1096 |
}} |
| 1097 |
pub type PCERT_RDN_ATTR = *mut CERT_RDN_ATTR; |
| 1098 |
pub const szOID_COMMON_NAME: &'static str = "2.5.4.3"; |
| 1099 |
pub const szOID_SUR_NAME: &'static str = "2.5.4.4"; |
| 1100 |
pub const szOID_DEVICE_SERIAL_NUMBER: &'static str = "2.5.4.5"; |
| 1101 |
pub const szOID_COUNTRY_NAME: &'static str = "2.5.4.6"; |
| 1102 |
pub const szOID_LOCALITY_NAME: &'static str = "2.5.4.7"; |
| 1103 |
pub const szOID_STATE_OR_PROVINCE_NAME: &'static str = "2.5.4.8"; |
| 1104 |
pub const szOID_STREET_ADDRESS: &'static str = "2.5.4.9"; |
| 1105 |
pub const szOID_ORGANIZATION_NAME: &'static str = "2.5.4.10"; |
| 1106 |
pub const szOID_ORGANIZATIONAL_UNIT_NAME: &'static str = "2.5.4.11"; |
| 1107 |
pub const szOID_TITLE: &'static str = "2.5.4.12"; |
| 1108 |
pub const szOID_DESCRIPTION: &'static str = "2.5.4.13"; |
| 1109 |
pub const szOID_SEARCH_GUIDE: &'static str = "2.5.4.14"; |
| 1110 |
pub const szOID_BUSINESS_CATEGORY: &'static str = "2.5.4.15"; |
| 1111 |
pub const szOID_POSTAL_ADDRESS: &'static str = "2.5.4.16"; |
| 1112 |
pub const szOID_POSTAL_CODE: &'static str = "2.5.4.17"; |
| 1113 |
pub const szOID_POST_OFFICE_BOX: &'static str = "2.5.4.18"; |
| 1114 |
pub const szOID_PHYSICAL_DELIVERY_OFFICE_NAME: &'static str = "2.5.4.19"; |
| 1115 |
pub const szOID_TELEPHONE_NUMBER: &'static str = "2.5.4.20"; |
| 1116 |
pub const szOID_TELEX_NUMBER: &'static str = "2.5.4.21"; |
| 1117 |
pub const szOID_TELETEXT_TERMINAL_IDENTIFIER: &'static str = "2.5.4.22"; |
| 1118 |
pub const szOID_FACSIMILE_TELEPHONE_NUMBER: &'static str = "2.5.4.23"; |
| 1119 |
pub const szOID_X21_ADDRESS: &'static str = "2.5.4.24"; |
| 1120 |
pub const szOID_INTERNATIONAL_ISDN_NUMBER: &'static str = "2.5.4.25"; |
| 1121 |
pub const szOID_REGISTERED_ADDRESS: &'static str = "2.5.4.26"; |
| 1122 |
pub const szOID_DESTINATION_INDICATOR: &'static str = "2.5.4.27"; |
| 1123 |
pub const szOID_PREFERRED_DELIVERY_METHOD: &'static str = "2.5.4.28"; |
| 1124 |
pub const szOID_PRESENTATION_ADDRESS: &'static str = "2.5.4.29"; |
| 1125 |
pub const szOID_SUPPORTED_APPLICATION_CONTEXT: &'static str = "2.5.4.30"; |
| 1126 |
pub const szOID_MEMBER: &'static str = "2.5.4.31"; |
| 1127 |
pub const szOID_OWNER: &'static str = "2.5.4.32"; |
| 1128 |
pub const szOID_ROLE_OCCUPANT: &'static str = "2.5.4.33"; |
| 1129 |
pub const szOID_SEE_ALSO: &'static str = "2.5.4.34"; |
| 1130 |
pub const szOID_USER_PASSWORD: &'static str = "2.5.4.35"; |
| 1131 |
pub const szOID_USER_CERTIFICATE: &'static str = "2.5.4.36"; |
| 1132 |
pub const szOID_CA_CERTIFICATE: &'static str = "2.5.4.37"; |
| 1133 |
pub const szOID_AUTHORITY_REVOCATION_LIST: &'static str = "2.5.4.38"; |
| 1134 |
pub const szOID_CERTIFICATE_REVOCATION_LIST: &'static str = "2.5.4.39"; |
| 1135 |
pub const szOID_CROSS_CERTIFICATE_PAIR: &'static str = "2.5.4.40"; |
| 1136 |
pub const szOID_GIVEN_NAME: &'static str = "2.5.4.42"; |
| 1137 |
pub const szOID_INITIALS: &'static str = "2.5.4.43"; |
| 1138 |
pub const szOID_DN_QUALIFIER: &'static str = "2.5.4.46"; |
| 1139 |
pub const szOID_DOMAIN_COMPONENT: &'static str = "0.9.2342.19200300.100.1.25"; |
| 1140 |
pub const szOID_PKCS_12_FRIENDLY_NAME_ATTR: &'static str = "1.2.840.113549.1.9.20"; |
| 1141 |
pub const szOID_PKCS_12_LOCAL_KEY_ID: &'static str = "1.2.840.113549.1.9.21"; |
| 1142 |
pub const szOID_PKCS_12_KEY_PROVIDER_NAME_ATTR: &'static str = "1.3.6.1.4.1.311.17.1"; |
| 1143 |
pub const szOID_LOCAL_MACHINE_KEYSET: &'static str = "1.3.6.1.4.1.311.17.2"; |
| 1144 |
pub const szOID_PKCS_12_EXTENDED_ATTRIBUTES: &'static str = "1.3.6.1.4.1.311.17.3"; |
| 1145 |
pub const szOID_PKCS_12_PROTECTED_PASSWORD_SECRET_BAG_TYPE_ID: &'static str |
| 1146 |
= "1.3.6.1.4.1.311.17.4"; |
| 1147 |
pub const szOID_KEYID_RDN: &'static str = "1.3.6.1.4.1.311.10.7.1"; |
| 1148 |
pub const szOID_EV_RDN_LOCALE: &'static str = "1.3.6.1.4.1.311.60.2.1.1"; |
| 1149 |
pub const szOID_EV_RDN_STATE_OR_PROVINCE: &'static str = "1.3.6.1.4.1.311.60.2.1.2"; |
| 1150 |
pub const szOID_EV_RDN_COUNTRY: &'static str = "1.3.6.1.4.1.311.60.2.1.3"; |
| 1151 |
pub const CERT_RDN_ANY_TYPE: DWORD = 0; |
| 1152 |
pub const CERT_RDN_ENCODED_BLOB: DWORD = 1; |
| 1153 |
pub const CERT_RDN_OCTET_STRING: DWORD = 2; |
| 1154 |
pub const CERT_RDN_NUMERIC_STRING: DWORD = 3; |
| 1155 |
pub const CERT_RDN_PRINTABLE_STRING: DWORD = 4; |
| 1156 |
pub const CERT_RDN_TELETEX_STRING: DWORD = 5; |
| 1157 |
pub const CERT_RDN_T61_STRING: DWORD = 5; |
| 1158 |
pub const CERT_RDN_VIDEOTEX_STRING: DWORD = 6; |
| 1159 |
pub const CERT_RDN_IA5_STRING: DWORD = 7; |
| 1160 |
pub const CERT_RDN_GRAPHIC_STRING: DWORD = 8; |
| 1161 |
pub const CERT_RDN_VISIBLE_STRING: DWORD = 9; |
| 1162 |
pub const CERT_RDN_ISO646_STRING: DWORD = 9; |
| 1163 |
pub const CERT_RDN_GENERAL_STRING: DWORD = 10; |
| 1164 |
pub const CERT_RDN_UNIVERSAL_STRING: DWORD = 11; |
| 1165 |
pub const CERT_RDN_INT4_STRING: DWORD = 11; |
| 1166 |
pub const CERT_RDN_BMP_STRING: DWORD = 12; |
| 1167 |
pub const CERT_RDN_UNICODE_STRING: DWORD = 12; |
| 1168 |
pub const CERT_RDN_UTF8_STRING: DWORD = 13; |
| 1169 |
pub const CERT_RDN_TYPE_MASK: DWORD = 0x000000FF; |
| 1170 |
pub const CERT_RDN_FLAGS_MASK: DWORD = 0xFF000000; |
| 1171 |
pub const CERT_RDN_ENABLE_T61_UNICODE_FLAG: DWORD = 0x80000000; |
| 1172 |
pub const CERT_RDN_ENABLE_UTF8_UNICODE_FLAG: DWORD = 0x20000000; |
| 1173 |
pub const CERT_RDN_FORCE_UTF8_UNICODE_FLAG: DWORD = 0x10000000; |
| 1174 |
pub const CERT_RDN_DISABLE_CHECK_TYPE_FLAG: DWORD = 0x40000000; |
| 1175 |
pub const CERT_RDN_DISABLE_IE4_UTF8_FLAG: DWORD = 0x01000000; |
| 1176 |
pub const CERT_RDN_ENABLE_PUNYCODE_FLAG: DWORD = 0x02000000; |
| 1177 |
#[inline] |
| 1178 |
pub fn IS_CERT_RDN_CHAR_STRING(X: DWORD) -> bool { |
| 1179 |
(X & CERT_RDN_TYPE_MASK) >= CERT_RDN_NUMERIC_STRING |
| 1180 |
} |
| 1181 |
STRUCT!{struct CERT_RDN { |
| 1182 |
cRDNAttr: DWORD, |
| 1183 |
rgRDNAttr: PCERT_RDN_ATTR, |
| 1184 |
}} |
| 1185 |
pub type PCERT_RDN = *mut CERT_RDN; |
| 1186 |
STRUCT!{struct CERT_NAME_INFO { |
| 1187 |
cRDN: DWORD, |
| 1188 |
rgRDN: PCERT_RDN, |
| 1189 |
}} |
| 1190 |
pub type PCERT_NAME_INFO = *mut CERT_NAME_INFO; |
| 1191 |
STRUCT!{struct CERT_NAME_VALUE { |
| 1192 |
dwValueType: DWORD, |
| 1193 |
Value: CERT_RDN_VALUE_BLOB, |
| 1194 |
}} |
| 1195 |
pub type PCERT_NAME_VALUE = *mut CERT_NAME_VALUE; |
| 1196 |
STRUCT!{struct CERT_PUBLIC_KEY_INFO { |
| 1197 |
Algorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1198 |
PublicKey: CRYPT_BIT_BLOB, |
| 1199 |
}} |
| 1200 |
pub type PCERT_PUBLIC_KEY_INFO = *mut CERT_PUBLIC_KEY_INFO; |
| 1201 |
pub const CERT_RSA_PUBLIC_KEY_OBJID: &'static str = szOID_RSA_RSA; |
| 1202 |
pub const CERT_DEFAULT_OID_PUBLIC_KEY_SIGN: &'static str = szOID_RSA_RSA; |
| 1203 |
pub const CERT_DEFAULT_OID_PUBLIC_KEY_XCHG: &'static str = szOID_RSA_RSA; |
| 1204 |
STRUCT!{struct CRYPT_ECC_PRIVATE_KEY_INFO { |
| 1205 |
dwVersion: DWORD, |
| 1206 |
PrivateKey: CRYPT_DER_BLOB, |
| 1207 |
szCurveOid: LPSTR, |
| 1208 |
PublicKey: CRYPT_BIT_BLOB, |
| 1209 |
}} |
| 1210 |
pub type PCRYPT_ECC_PRIVATE_KEY_INFO = *mut CRYPT_ECC_PRIVATE_KEY_INFO; |
| 1211 |
pub const CRYPT_ECC_PRIVATE_KEY_INFO_v1: DWORD = 1; |
| 1212 |
STRUCT!{struct CRYPT_PRIVATE_KEY_INFO { |
| 1213 |
Version: DWORD, |
| 1214 |
Algorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1215 |
PrivateKey: CRYPT_DER_BLOB, |
| 1216 |
pAttributes: PCRYPT_ATTRIBUTES, |
| 1217 |
}} |
| 1218 |
pub type PCRYPT_PRIVATE_KEY_INFO = *mut CRYPT_PRIVATE_KEY_INFO; |
| 1219 |
STRUCT!{struct CRYPT_ENCRYPTED_PRIVATE_KEY_INFO { |
| 1220 |
EncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1221 |
EncryptedPrivateKey: CRYPT_DATA_BLOB, |
| 1222 |
}} |
| 1223 |
pub type PCRYPT_ENCRYPTED_PRIVATE_KEY_INFO = *mut CRYPT_ENCRYPTED_PRIVATE_KEY_INFO; |
| 1224 |
FN!{stdcall PCRYPT_DECRYPT_PRIVATE_KEY_FUNC( |
| 1225 |
Algorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1226 |
EncryptedPrivateKey: CRYPT_DATA_BLOB, |
| 1227 |
pbClearTextKey: *mut BYTE, |
| 1228 |
pcbClearTextKey: *mut DWORD, |
| 1229 |
pVoidDecryptFunc: LPVOID, |
| 1230 |
) -> BOOL} |
| 1231 |
FN!{stdcall PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC( |
| 1232 |
Algorithm: *mut CRYPT_ALGORITHM_IDENTIFIER, |
| 1233 |
pClearTextPrivateKey: *mut CRYPT_DATA_BLOB, |
| 1234 |
pbEncryptedKey: *mut BYTE, |
| 1235 |
pcbEncryptedKey: *mut DWORD, |
| 1236 |
pVoidEncryptFunc: LPVOID, |
| 1237 |
) -> BOOL} |
| 1238 |
FN!{stdcall PCRYPT_RESOLVE_HCRYPTPROV_FUNC( |
| 1239 |
pPrivateKeyInfo: *mut CRYPT_PRIVATE_KEY_INFO, |
| 1240 |
phCryptProv: *mut HCRYPTPROV, |
| 1241 |
pVoidResolveFunc: LPVOID, |
| 1242 |
) -> BOOL} |
| 1243 |
STRUCT!{struct CRYPT_PKCS8_IMPORT_PARAMS { |
| 1244 |
PrivateKey: CRYPT_DIGEST_BLOB, |
| 1245 |
pResolvehCryptProvFunc: PCRYPT_RESOLVE_HCRYPTPROV_FUNC, |
| 1246 |
pVoidResolveFunc: LPVOID, |
| 1247 |
pDecryptPrivateKeyFunc: PCRYPT_DECRYPT_PRIVATE_KEY_FUNC, |
| 1248 |
pVoidDecryptFunc: LPVOID, |
| 1249 |
}} |
| 1250 |
pub type PCRYPT_PKCS8_IMPORT_PARAMS = *mut CRYPT_PKCS8_IMPORT_PARAMS; |
| 1251 |
pub type CRYPT_PRIVATE_KEY_BLOB_AND_PARAMS = CRYPT_PKCS8_IMPORT_PARAMS; |
| 1252 |
pub type PPCRYPT_PRIVATE_KEY_BLOB_AND_PARAMS = *mut CRYPT_PKCS8_IMPORT_PARAMS; |
| 1253 |
STRUCT!{struct CRYPT_PKCS8_EXPORT_PARAMS { |
| 1254 |
hCryptProv: HCRYPTPROV, |
| 1255 |
dwKeySpec: DWORD, |
| 1256 |
pszPrivateKeyObjId: LPSTR, |
| 1257 |
pEncryptPrivateKeyFunc: PCRYPT_ENCRYPT_PRIVATE_KEY_FUNC, |
| 1258 |
pVoidEncryptFunc: LPVOID, |
| 1259 |
}} |
| 1260 |
pub type PCRYPT_PKCS8_EXPORT_PARAMS = *mut CRYPT_PKCS8_EXPORT_PARAMS; |
| 1261 |
STRUCT!{struct CERT_INFO { |
| 1262 |
dwVersion: DWORD, |
| 1263 |
SerialNumber: CRYPT_INTEGER_BLOB, |
| 1264 |
SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1265 |
Issuer: CERT_NAME_BLOB, |
| 1266 |
NotBefore: FILETIME, |
| 1267 |
NotAfter: FILETIME, |
| 1268 |
Subject: CERT_NAME_BLOB, |
| 1269 |
SubjectPublicKeyInfo: CERT_PUBLIC_KEY_INFO, |
| 1270 |
IssuerUniqueId: CRYPT_BIT_BLOB, |
| 1271 |
SubjectUniqueId: CRYPT_BIT_BLOB, |
| 1272 |
cExtension: DWORD, |
| 1273 |
rgExtension: PCERT_EXTENSION, |
| 1274 |
}} |
| 1275 |
pub type PCERT_INFO = *mut CERT_INFO; |
| 1276 |
pub const CERT_V1: DWORD = 0; |
| 1277 |
pub const CERT_V2: DWORD = 1; |
| 1278 |
pub const CERT_V3: DWORD = 2; |
| 1279 |
pub const CERT_INFO_VERSION_FLAG: DWORD = 1; |
| 1280 |
pub const CERT_INFO_SERIAL_NUMBER_FLAG: DWORD = 2; |
| 1281 |
pub const CERT_INFO_SIGNATURE_ALGORITHM_FLAG: DWORD = 3; |
| 1282 |
pub const CERT_INFO_ISSUER_FLAG: DWORD = 4; |
| 1283 |
pub const CERT_INFO_NOT_BEFORE_FLAG: DWORD = 5; |
| 1284 |
pub const CERT_INFO_NOT_AFTER_FLAG: DWORD = 6; |
| 1285 |
pub const CERT_INFO_SUBJECT_FLAG: DWORD = 7; |
| 1286 |
pub const CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG: DWORD = 8; |
| 1287 |
pub const CERT_INFO_ISSUER_UNIQUE_ID_FLAG: DWORD = 9; |
| 1288 |
pub const CERT_INFO_SUBJECT_UNIQUE_ID_FLAG: DWORD = 10; |
| 1289 |
pub const CERT_INFO_EXTENSION_FLAG: DWORD = 11; |
| 1290 |
STRUCT!{struct CRL_ENTRY { |
| 1291 |
SerialNumber: CRYPT_INTEGER_BLOB, |
| 1292 |
RevocationDate: FILETIME, |
| 1293 |
cExtension: DWORD, |
| 1294 |
rgExtension: PCERT_EXTENSION, |
| 1295 |
}} |
| 1296 |
pub type PCRL_ENTRY = *mut CRL_ENTRY; |
| 1297 |
STRUCT!{struct CRL_INFO { |
| 1298 |
dwVersion: DWORD, |
| 1299 |
SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1300 |
Issuer: CERT_NAME_BLOB, |
| 1301 |
ThisUpdate: FILETIME, |
| 1302 |
NextUpdate: FILETIME, |
| 1303 |
cCRLEntry: DWORD, |
| 1304 |
rgCRLEntry: PCRL_ENTRY, |
| 1305 |
cExtension: DWORD, |
| 1306 |
rgExtension: PCERT_EXTENSION, |
| 1307 |
}} |
| 1308 |
pub type PCRL_INFO = *mut CRL_INFO; |
| 1309 |
pub const CRL_V1: DWORD = 0; |
| 1310 |
pub const CRL_V2: DWORD = 1; |
| 1311 |
pub const CERT_BUNDLE_CERTIFICATE: DWORD = 0; |
| 1312 |
pub const CERT_BUNDLE_CRL: DWORD = 1; |
| 1313 |
STRUCT!{struct CERT_OR_CRL_BLOB { |
| 1314 |
dwChoice: DWORD, |
| 1315 |
cbEncoded: DWORD, |
| 1316 |
pbEncoded: *mut BYTE, |
| 1317 |
}} |
| 1318 |
pub type PCERT_OR_CRL_BLOB = *mut CERT_OR_CRL_BLOB; |
| 1319 |
STRUCT!{struct CERT_OR_CRL_BUNDLE { |
| 1320 |
cItem: DWORD, |
| 1321 |
rgItem: PCERT_OR_CRL_BLOB, |
| 1322 |
}} |
| 1323 |
pub type PCERT_OR_CRL_BUNDLE = *mut CERT_OR_CRL_BUNDLE; |
| 1324 |
STRUCT!{struct CERT_REQUEST_INFO { |
| 1325 |
dwVersion: DWORD, |
| 1326 |
Subject: CERT_NAME_BLOB, |
| 1327 |
SubjectPublicKeyInfo: CERT_PUBLIC_KEY_INFO, |
| 1328 |
cAttribute: DWORD, |
| 1329 |
rgAttribute: PCRYPT_ATTRIBUTE, |
| 1330 |
}} |
| 1331 |
pub type PCERT_REQUEST_INFO = *mut CERT_REQUEST_INFO; |
| 1332 |
pub const CERT_REQUEST_V1: DWORD = 0; |
| 1333 |
STRUCT!{struct CERT_KEYGEN_REQUEST_INFO { |
| 1334 |
dwVersion: DWORD, |
| 1335 |
SubjectPublicKeyInfo: CERT_PUBLIC_KEY_INFO, |
| 1336 |
pwszChallengeString: LPWSTR, |
| 1337 |
}} |
| 1338 |
pub type PCERT_KEYGEN_REQUEST_INFO = *mut CERT_KEYGEN_REQUEST_INFO; |
| 1339 |
pub const CERT_KEYGEN_REQUEST_V1: DWORD = 0; |
| 1340 |
STRUCT!{struct CERT_SIGNED_CONTENT_INFO { |
| 1341 |
ToBeSigned: CRYPT_DER_BLOB, |
| 1342 |
SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1343 |
Signature: CRYPT_BIT_BLOB, |
| 1344 |
}} |
| 1345 |
pub type PCERT_SIGNED_CONTENT_INFO = *mut CERT_SIGNED_CONTENT_INFO; |
| 1346 |
STRUCT!{struct CTL_USAGE { |
| 1347 |
cUsageIdentifier: DWORD, |
| 1348 |
rgpszUsageIdentifier: *mut LPSTR, |
| 1349 |
}} |
| 1350 |
pub type PCTL_USAGE = *mut CTL_USAGE; |
| 1351 |
pub type CERT_ENHKEY_USAGE = CTL_USAGE; |
| 1352 |
pub type PCERT_ENHKEY_USAGE = *mut CERT_ENHKEY_USAGE; |
| 1353 |
pub type PCCTL_USAGE = *const CTL_USAGE; |
| 1354 |
pub type PCCERT_ENHKEY_USAGE = *const CERT_ENHKEY_USAGE; |
| 1355 |
STRUCT!{struct CTL_ENTRY { |
| 1356 |
SubjectIdentifier: CRYPT_DATA_BLOB, |
| 1357 |
cAttribute: DWORD, |
| 1358 |
rgAttribute: PCRYPT_ATTRIBUTE, |
| 1359 |
}} |
| 1360 |
pub type PCTL_ENTRY = *mut CTL_ENTRY; |
| 1361 |
STRUCT!{struct CTL_INFO { |
| 1362 |
dwVersion: DWORD, |
| 1363 |
SubjectUsage: CTL_USAGE, |
| 1364 |
ListIdentifier: CRYPT_DATA_BLOB, |
| 1365 |
SequenceNumber: CRYPT_INTEGER_BLOB, |
| 1366 |
ThisUpdate: FILETIME, |
| 1367 |
NextUpdate: FILETIME, |
| 1368 |
SubjectAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 1369 |
cCTLEntry: DWORD, |
| 1370 |
rgCTLEntry: PCTL_ENTRY, |
| 1371 |
cExtension: DWORD, |
| 1372 |
rgExtension: PCERT_EXTENSION, |
| 1373 |
}} |
| 1374 |
pub type PCTL_INFO = *mut CTL_INFO; |
| 1375 |
pub const CTL_V1: DWORD = 0; |
| 1376 |
STRUCT!{struct CRYPT_TIME_STAMP_REQUEST_INFO { |
| 1377 |
pszTimeStampAlgorithm: LPSTR, |
| 1378 |
pszContentType: LPSTR, |
| 1379 |
Content: CRYPT_OBJID_BLOB, |
| 1380 |
cAttribute: DWORD, |
| 1381 |
rgAttribute: PCRYPT_ATTRIBUTE, |
| 1382 |
}} |
| 1383 |
pub type PCRYPT_TIME_STAMP_REQUEST_INFO = *mut CRYPT_TIME_STAMP_REQUEST_INFO; |
| 1384 |
STRUCT!{struct CRYPT_ENROLLMENT_NAME_VALUE_PAIR { |
| 1385 |
pwszName: LPWSTR, |
| 1386 |
pwszValue: LPWSTR, |
| 1387 |
}} |
| 1388 |
pub type PCRYPT_ENROLLMENT_NAME_VALUE_PAIR = *mut CRYPT_ENROLLMENT_NAME_VALUE_PAIR; |
| 1389 |
STRUCT!{struct CRYPT_CSP_PROVIDER { |
| 1390 |
dwKeySpec: DWORD, |
| 1391 |
pwszProviderName: LPWSTR, |
| 1392 |
Signature: CRYPT_BIT_BLOB, |
| 1393 |
}} |
| 1394 |
pub type PCRYPT_CSP_PROVIDER = *mut CRYPT_CSP_PROVIDER; |
| 1395 |
pub const CERT_ENCODING_TYPE_MASK: DWORD = 0x0000FFFF; |
| 1396 |
pub const CMSG_ENCODING_TYPE_MASK: DWORD = 0xFFFF0000; |
| 1397 |
#[inline] |
| 1398 |
pub fn GET_CERT_ENCODING_TYPE(X: DWORD) -> DWORD { |
| 1399 |
X & CERT_ENCODING_TYPE_MASK |
| 1400 |
} |
| 1401 |
#[inline] |
| 1402 |
pub fn GET_CMSG_ENCODING_TYPE(X: DWORD) -> DWORD { |
| 1403 |
X & CMSG_ENCODING_TYPE_MASK |
| 1404 |
} |
| 1405 |
pub const CRYPT_ASN_ENCODING: DWORD = 0x00000001; |
| 1406 |
pub const CRYPT_NDR_ENCODING: DWORD = 0x00000002; |
| 1407 |
pub const X509_ASN_ENCODING: DWORD = 0x00000001; |
| 1408 |
pub const X509_NDR_ENCODING: DWORD = 0x00000002; |
| 1409 |
pub const PKCS_7_ASN_ENCODING: DWORD = 0x00010000; |
| 1410 |
pub const PKCS_7_NDR_ENCODING: DWORD = 0x00020000; |
| 1411 |
extern "system" { |
| 1412 |
pub fn CryptFormatObject( |
| 1413 |
dwCertEncodingType: DWORD, |
| 1414 |
dwFormatType: DWORD, |
| 1415 |
dwFormatStrType: DWORD, |
| 1416 |
pFormatStruct: *mut c_void, |
| 1417 |
lpszStructType: LPCSTR, |
| 1418 |
pbEncoded: *const BYTE, |
| 1419 |
cbEncoded: DWORD, |
| 1420 |
pbFormat: *mut c_void, |
| 1421 |
pcbFormat: *mut DWORD, |
| 1422 |
) -> BOOL; |
| 1423 |
} |
| 1424 |
pub const CRYPT_FORMAT_STR_MULTI_LINE: DWORD = 0x0001; |
| 1425 |
pub const CRYPT_FORMAT_STR_NO_HEX: DWORD = 0x0010; |
| 1426 |
pub const CRYPT_FORMAT_SIMPLE: DWORD = 0x0001; |
| 1427 |
pub const CRYPT_FORMAT_X509: DWORD = 0x0002; |
| 1428 |
pub const CRYPT_FORMAT_OID: DWORD = 0x0004; |
| 1429 |
pub const CRYPT_FORMAT_RDN_SEMICOLON: DWORD = 0x0100; |
| 1430 |
pub const CRYPT_FORMAT_RDN_CRLF: DWORD = 0x0200; |
| 1431 |
pub const CRYPT_FORMAT_RDN_UNQUOTE: DWORD = 0x0400; |
| 1432 |
pub const CRYPT_FORMAT_RDN_REVERSE: DWORD = 0x0800; |
| 1433 |
pub const CRYPT_FORMAT_COMMA: DWORD = 0x1000; |
| 1434 |
pub const CRYPT_FORMAT_SEMICOLON: DWORD = CRYPT_FORMAT_RDN_SEMICOLON; |
| 1435 |
pub const CRYPT_FORMAT_CRLF: DWORD = CRYPT_FORMAT_RDN_CRLF; |
| 1436 |
FN!{stdcall PFN_CRYPT_ALLOC( |
| 1437 |
cbSize: size_t, |
| 1438 |
) -> LPVOID} |
| 1439 |
FN!{stdcall PFN_CRYPT_FREE( |
| 1440 |
pv: LPVOID, |
| 1441 |
) -> ()} |
| 1442 |
STRUCT!{struct CRYPT_ENCODE_PARA { |
| 1443 |
cbSize: DWORD, |
| 1444 |
pfnAlloc: PFN_CRYPT_ALLOC, |
| 1445 |
pfnFree: PFN_CRYPT_FREE, |
| 1446 |
}} |
| 1447 |
pub type PCRYPT_ENCODE_PARA = *mut CRYPT_ENCODE_PARA; |
| 1448 |
extern "system" { |
| 1449 |
pub fn CryptEncodeObjectEx( |
| 1450 |
dwCertEncodingType: DWORD, |
| 1451 |
lpszStructType: LPCSTR, |
| 1452 |
pvStructInfo: *const c_void, |
| 1453 |
dwFlags: DWORD, |
| 1454 |
pEncodePara: PCRYPT_ENCODE_PARA, |
| 1455 |
pvEncoded: *mut c_void, |
| 1456 |
pcbEncoded: *mut DWORD, |
| 1457 |
) -> BOOL; |
| 1458 |
pub fn CryptEncodeObject( |
| 1459 |
dwCertEncodingType: DWORD, |
| 1460 |
lpszStructType: LPCSTR, |
| 1461 |
pvStructInfo: *const c_void, |
| 1462 |
pbEncoded: *mut BYTE, |
| 1463 |
pcbEncoded: *mut DWORD, |
| 1464 |
) -> BOOL; |
| 1465 |
} |
| 1466 |
pub const CRYPT_ENCODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG: DWORD = 0x8; |
| 1467 |
pub const CRYPT_ENCODE_ALLOC_FLAG: DWORD = 0x8000; |
| 1468 |
pub const CRYPT_UNICODE_NAME_ENCODE_ENABLE_T61_UNICODE_FLAG: DWORD |
| 1469 |
= CERT_RDN_ENABLE_T61_UNICODE_FLAG; |
| 1470 |
pub const CRYPT_UNICODE_NAME_ENCODE_ENABLE_UTF8_UNICODE_FLAG: DWORD |
| 1471 |
= CERT_RDN_ENABLE_UTF8_UNICODE_FLAG; |
| 1472 |
pub const CRYPT_UNICODE_NAME_ENCODE_FORCE_UTF8_UNICODE_FLAG: DWORD |
| 1473 |
= CERT_RDN_FORCE_UTF8_UNICODE_FLAG; |
| 1474 |
pub const CRYPT_UNICODE_NAME_ENCODE_DISABLE_CHECK_TYPE_FLAG: DWORD |
| 1475 |
= CERT_RDN_DISABLE_CHECK_TYPE_FLAG; |
| 1476 |
pub const CRYPT_SORTED_CTL_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG: DWORD = 0x10000; |
| 1477 |
pub const CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG: DWORD = 0x20000; |
| 1478 |
pub const CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG: DWORD = 0x40000; |
| 1479 |
pub const CRYPT_ENCODE_ENABLE_IA5CONVERSION_FLAG: DWORD = CRYPT_ENCODE_ENABLE_PUNYCODE_FLAG |
| 1480 |
| CRYPT_ENCODE_ENABLE_UTF8PERCENT_FLAG; |
| 1481 |
STRUCT!{struct CRYPT_DECODE_PARA { |
| 1482 |
cbSize: DWORD, |
| 1483 |
pfnAlloc: PFN_CRYPT_ALLOC, |
| 1484 |
pfnFree: PFN_CRYPT_FREE, |
| 1485 |
}} |
| 1486 |
pub type PCRYPT_DECODE_PARA = *mut CRYPT_DECODE_PARA; |
| 1487 |
extern "system" { |
| 1488 |
pub fn CryptDecodeObjectEx( |
| 1489 |
dwCertEncodingType: DWORD, |
| 1490 |
lpszStructType: LPCSTR, |
| 1491 |
pbEncoded: *const BYTE, |
| 1492 |
cbEncoded: DWORD, |
| 1493 |
dwFlags: DWORD, |
| 1494 |
pDecodePara: PCRYPT_DECODE_PARA, |
| 1495 |
pvStructInfo: *mut c_void, |
| 1496 |
pcbStructInfo: *mut DWORD, |
| 1497 |
) -> BOOL; |
| 1498 |
pub fn CryptDecodeObject( |
| 1499 |
dwCertEncodingType: DWORD, |
| 1500 |
lpszStructType: LPCSTR, |
| 1501 |
pbEncoded: *const BYTE, |
| 1502 |
cbEncoded: DWORD, |
| 1503 |
dwFlags: DWORD, |
| 1504 |
pvStructInfo: *mut c_void, |
| 1505 |
pcbStructInfo: *mut DWORD, |
| 1506 |
) -> BOOL; |
| 1507 |
} |
| 1508 |
pub const CRYPT_DECODE_NOCOPY_FLAG: DWORD = 0x1; |
| 1509 |
pub const CRYPT_DECODE_TO_BE_SIGNED_FLAG: DWORD = 0x2; |
| 1510 |
pub const CRYPT_DECODE_SHARE_OID_STRING_FLAG: DWORD = 0x4; |
| 1511 |
pub const CRYPT_DECODE_NO_SIGNATURE_BYTE_REVERSAL_FLAG: DWORD = 0x8; |
| 1512 |
pub const CRYPT_DECODE_ALLOC_FLAG: DWORD = 0x8000; |
| 1513 |
pub const CRYPT_UNICODE_NAME_DECODE_DISABLE_IE4_UTF8_FLAG: DWORD |
| 1514 |
= CERT_RDN_DISABLE_IE4_UTF8_FLAG; |
| 1515 |
pub const CRYPT_DECODE_ENABLE_PUNYCODE_FLAG: DWORD = 0x02000000; |
| 1516 |
pub const CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG: DWORD = 0x04000000; |
| 1517 |
pub const CRYPT_DECODE_ENABLE_IA5CONVERSION_FLAG: DWORD = CRYPT_DECODE_ENABLE_PUNYCODE_FLAG |
| 1518 |
| CRYPT_DECODE_ENABLE_UTF8PERCENT_FLAG; |
| 1519 |
pub const CRYPT_ENCODE_DECODE_NONE: LPCSTR = 0 as LPCSTR; |
| 1520 |
pub const X509_CERT: LPCSTR = 1 as LPCSTR; |
| 1521 |
pub const X509_CERT_TO_BE_SIGNED: LPCSTR = 2 as LPCSTR; |
| 1522 |
pub const X509_CERT_CRL_TO_BE_SIGNED: LPCSTR = 3 as LPCSTR; |
| 1523 |
pub const X509_CERT_REQUEST_TO_BE_SIGNED: LPCSTR = 4 as LPCSTR; |
| 1524 |
pub const X509_EXTENSIONS: LPCSTR = 5 as LPCSTR; |
| 1525 |
pub const X509_NAME_VALUE: LPCSTR = 6 as LPCSTR; |
| 1526 |
pub const X509_NAME: LPCSTR = 7 as LPCSTR; |
| 1527 |
pub const X509_PUBLIC_KEY_INFO: LPCSTR = 8 as LPCSTR; |
| 1528 |
pub const X509_AUTHORITY_KEY_ID: LPCSTR = 9 as LPCSTR; |
| 1529 |
pub const X509_KEY_ATTRIBUTES: LPCSTR = 10 as LPCSTR; |
| 1530 |
pub const X509_KEY_USAGE_RESTRICTION: LPCSTR = 11 as LPCSTR; |
| 1531 |
pub const X509_ALTERNATE_NAME: LPCSTR = 12 as LPCSTR; |
| 1532 |
pub const X509_BASIC_CONSTRAINTS: LPCSTR = 13 as LPCSTR; |
| 1533 |
pub const X509_KEY_USAGE: LPCSTR = 14 as LPCSTR; |
| 1534 |
pub const X509_BASIC_CONSTRAINTS2: LPCSTR = 15 as LPCSTR; |
| 1535 |
pub const X509_CERT_POLICIES: LPCSTR = 16 as LPCSTR; |
| 1536 |
pub const PKCS_UTC_TIME: LPCSTR = 17 as LPCSTR; |
| 1537 |
pub const PKCS_TIME_REQUEST: LPCSTR = 18 as LPCSTR; |
| 1538 |
pub const RSA_CSP_PUBLICKEYBLOB: LPCSTR = 19 as LPCSTR; |
| 1539 |
pub const X509_UNICODE_NAME: LPCSTR = 20 as LPCSTR; |
| 1540 |
pub const X509_KEYGEN_REQUEST_TO_BE_SIGNED: LPCSTR = 21 as LPCSTR; |
| 1541 |
pub const PKCS_ATTRIBUTE: LPCSTR = 22 as LPCSTR; |
| 1542 |
pub const PKCS_CONTENT_INFO_SEQUENCE_OF_ANY: LPCSTR = 23 as LPCSTR; |
| 1543 |
pub const X509_UNICODE_NAME_VALUE: LPCSTR = 24 as LPCSTR; |
| 1544 |
pub const X509_ANY_STRING: LPCSTR = X509_NAME_VALUE; |
| 1545 |
pub const X509_UNICODE_ANY_STRING: LPCSTR = X509_UNICODE_NAME_VALUE; |
| 1546 |
pub const X509_OCTET_STRING: LPCSTR = 25 as LPCSTR; |
| 1547 |
pub const X509_BITS: LPCSTR = 26 as LPCSTR; |
| 1548 |
pub const X509_INTEGER: LPCSTR = 27 as LPCSTR; |
| 1549 |
pub const X509_MULTI_BYTE_INTEGER: LPCSTR = 28 as LPCSTR; |
| 1550 |
pub const X509_ENUMERATED: LPCSTR = 29 as LPCSTR; |
| 1551 |
pub const X509_CHOICE_OF_TIME: LPCSTR = 30 as LPCSTR; |
| 1552 |
pub const X509_AUTHORITY_KEY_ID2: LPCSTR = 31 as LPCSTR; |
| 1553 |
pub const X509_AUTHORITY_INFO_ACCESS: LPCSTR = 32 as LPCSTR; |
| 1554 |
pub const X509_SUBJECT_INFO_ACCESS: LPCSTR = X509_AUTHORITY_INFO_ACCESS; |
| 1555 |
pub const X509_CRL_REASON_CODE: LPCSTR = X509_ENUMERATED; |
| 1556 |
pub const PKCS_CONTENT_INFO: LPCSTR = 33 as LPCSTR; |
| 1557 |
pub const X509_SEQUENCE_OF_ANY: LPCSTR = 34 as LPCSTR; |
| 1558 |
pub const X509_CRL_DIST_POINTS: LPCSTR = 35 as LPCSTR; |
| 1559 |
pub const X509_ENHANCED_KEY_USAGE: LPCSTR = 36 as LPCSTR; |
| 1560 |
pub const PKCS_CTL: LPCSTR = 37 as LPCSTR; |
| 1561 |
pub const X509_MULTI_BYTE_UINT: LPCSTR = 38 as LPCSTR; |
| 1562 |
pub const X509_DSS_PUBLICKEY: LPCSTR = X509_MULTI_BYTE_UINT; |
| 1563 |
pub const X509_DSS_PARAMETERS: LPCSTR = 39 as LPCSTR; |
| 1564 |
pub const X509_DSS_SIGNATURE: LPCSTR = 40 as LPCSTR; |
| 1565 |
pub const PKCS_RC2_CBC_PARAMETERS: LPCSTR = 41 as LPCSTR; |
| 1566 |
pub const PKCS_SMIME_CAPABILITIES: LPCSTR = 42 as LPCSTR; |
| 1567 |
pub const X509_QC_STATEMENTS_EXT: LPCSTR = 42 as LPCSTR; |
| 1568 |
pub const PKCS_RSA_PRIVATE_KEY: LPCSTR = 43 as LPCSTR; |
| 1569 |
pub const PKCS_PRIVATE_KEY_INFO: LPCSTR = 44 as LPCSTR; |
| 1570 |
pub const PKCS_ENCRYPTED_PRIVATE_KEY_INFO: LPCSTR = 45 as LPCSTR; |
| 1571 |
pub const X509_PKIX_POLICY_QUALIFIER_USERNOTICE: LPCSTR = 46 as LPCSTR; |
| 1572 |
pub const X509_DH_PUBLICKEY: LPCSTR = X509_MULTI_BYTE_UINT; |
| 1573 |
pub const X509_DH_PARAMETERS: LPCSTR = 47 as LPCSTR; |
| 1574 |
pub const PKCS_ATTRIBUTES: LPCSTR = 48 as LPCSTR; |
| 1575 |
pub const PKCS_SORTED_CTL: LPCSTR = 49 as LPCSTR; |
| 1576 |
pub const X509_ECC_SIGNATURE: LPCSTR = 47 as LPCSTR; |
| 1577 |
pub const X942_DH_PARAMETERS: LPCSTR = 50 as LPCSTR; |
| 1578 |
pub const X509_BITS_WITHOUT_TRAILING_ZEROES: LPCSTR = 51 as LPCSTR; |
| 1579 |
pub const X942_OTHER_INFO: LPCSTR = 52 as LPCSTR; |
| 1580 |
pub const X509_CERT_PAIR: LPCSTR = 53 as LPCSTR; |
| 1581 |
pub const X509_ISSUING_DIST_POINT: LPCSTR = 54 as LPCSTR; |
| 1582 |
pub const X509_NAME_CONSTRAINTS: LPCSTR = 55 as LPCSTR; |
| 1583 |
pub const X509_POLICY_MAPPINGS: LPCSTR = 56 as LPCSTR; |
| 1584 |
pub const X509_POLICY_CONSTRAINTS: LPCSTR = 57 as LPCSTR; |
| 1585 |
pub const X509_CROSS_CERT_DIST_POINTS: LPCSTR = 58 as LPCSTR; |
| 1586 |
pub const CMC_DATA: LPCSTR = 59 as LPCSTR; |
| 1587 |
pub const CMC_RESPONSE: LPCSTR = 60 as LPCSTR; |
| 1588 |
pub const CMC_STATUS: LPCSTR = 61 as LPCSTR; |
| 1589 |
pub const CMC_ADD_EXTENSIONS: LPCSTR = 62 as LPCSTR; |
| 1590 |
pub const CMC_ADD_ATTRIBUTES: LPCSTR = 63 as LPCSTR; |
| 1591 |
pub const X509_CERTIFICATE_TEMPLATE: LPCSTR = 64 as LPCSTR; |
| 1592 |
pub const OCSP_SIGNED_REQUEST: LPCSTR = 65 as LPCSTR; |
| 1593 |
pub const OCSP_REQUEST: LPCSTR = 66 as LPCSTR; |
| 1594 |
pub const OCSP_RESPONSE: LPCSTR = 67 as LPCSTR; |
| 1595 |
pub const OCSP_BASIC_SIGNED_RESPONSE: LPCSTR = 68 as LPCSTR; |
| 1596 |
pub const OCSP_BASIC_RESPONSE: LPCSTR = 69 as LPCSTR; |
| 1597 |
pub const X509_LOGOTYPE_EXT: LPCSTR = 70 as LPCSTR; |
| 1598 |
pub const X509_BIOMETRIC_EXT: LPCSTR = 71 as LPCSTR; |
| 1599 |
pub const CNG_RSA_PUBLIC_KEY_BLOB: LPCSTR = 72 as LPCSTR; |
| 1600 |
pub const X509_OBJECT_IDENTIFIER: LPCSTR = 73 as LPCSTR; |
| 1601 |
pub const X509_ALGORITHM_IDENTIFIER: LPCSTR = 74 as LPCSTR; |
| 1602 |
pub const PKCS_RSA_SSA_PSS_PARAMETERS: LPCSTR = 75 as LPCSTR; |
| 1603 |
pub const PKCS_RSAES_OAEP_PARAMETERS: LPCSTR = 76 as LPCSTR; |
| 1604 |
pub const ECC_CMS_SHARED_INFO: LPCSTR = 77 as LPCSTR; |
| 1605 |
pub const TIMESTAMP_REQUEST: LPCSTR = 78 as LPCSTR; |
| 1606 |
pub const TIMESTAMP_RESPONSE: LPCSTR = 79 as LPCSTR; |
| 1607 |
pub const TIMESTAMP_INFO: LPCSTR = 80 as LPCSTR; |
| 1608 |
pub const X509_CERT_BUNDLE: LPCSTR = 81 as LPCSTR; |
| 1609 |
pub const X509_ECC_PRIVATE_KEY: LPCSTR = 82 as LPCSTR; |
| 1610 |
pub const CNG_RSA_PRIVATE_KEY_BLOB: LPCSTR = 83 as LPCSTR; |
| 1611 |
pub const X509_SUBJECT_DIR_ATTRS: LPCSTR = 84 as LPCSTR; |
| 1612 |
pub const X509_ECC_PARAMETERS: LPCSTR = 85 as LPCSTR; |
| 1613 |
pub const PKCS7_SIGNER_INFO: LPCSTR = 500 as LPCSTR; |
| 1614 |
pub const CMS_SIGNER_INFO: LPCSTR = 501 as LPCSTR; |
| 1615 |
pub const szOID_AUTHORITY_KEY_IDENTIFIER: &'static str = "2.5.29.1"; |
| 1616 |
pub const szOID_KEY_ATTRIBUTES: &'static str = "2.5.29.2"; |
| 1617 |
pub const szOID_CERT_POLICIES_95: &'static str = "2.5.29.3"; |
| 1618 |
pub const szOID_KEY_USAGE_RESTRICTION: &'static str = "2.5.29.4"; |
| 1619 |
pub const szOID_SUBJECT_ALT_NAME: &'static str = "2.5.29.7"; |
| 1620 |
pub const szOID_ISSUER_ALT_NAME: &'static str = "2.5.29.8"; |
| 1621 |
pub const szOID_BASIC_CONSTRAINTS: &'static str = "2.5.29.10"; |
| 1622 |
pub const szOID_KEY_USAGE: &'static str = "2.5.29.15"; |
| 1623 |
pub const szOID_PRIVATEKEY_USAGE_PERIOD: &'static str = "2.5.29.16"; |
| 1624 |
pub const szOID_BASIC_CONSTRAINTS2: &'static str = "2.5.29.19"; |
| 1625 |
pub const szOID_CERT_POLICIES: &'static str = "2.5.29.32"; |
| 1626 |
pub const szOID_ANY_CERT_POLICY: &'static str = "2.5.29.32.0"; |
| 1627 |
pub const szOID_INHIBIT_ANY_POLICY: &'static str = "2.5.29.54"; |
| 1628 |
pub const szOID_AUTHORITY_KEY_IDENTIFIER2: &'static str = "2.5.29.35"; |
| 1629 |
pub const szOID_SUBJECT_KEY_IDENTIFIER: &'static str = "2.5.29.14"; |
| 1630 |
pub const szOID_SUBJECT_ALT_NAME2: &'static str = "2.5.29.17"; |
| 1631 |
pub const szOID_ISSUER_ALT_NAME2: &'static str = "2.5.29.18"; |
| 1632 |
pub const szOID_CRL_REASON_CODE: &'static str = "2.5.29.21"; |
| 1633 |
pub const szOID_REASON_CODE_HOLD: &'static str = "2.5.29.23"; |
| 1634 |
pub const szOID_CRL_DIST_POINTS: &'static str = "2.5.29.31"; |
| 1635 |
pub const szOID_ENHANCED_KEY_USAGE: &'static str = "2.5.29.37"; |
| 1636 |
pub const szOID_ANY_ENHANCED_KEY_USAGE: &'static str = "2.5.29.37.0"; |
| 1637 |
pub const szOID_CRL_NUMBER: &'static str = "2.5.29.20"; |
| 1638 |
pub const szOID_DELTA_CRL_INDICATOR: &'static str = "2.5.29.27"; |
| 1639 |
pub const szOID_ISSUING_DIST_POINT: &'static str = "2.5.29.28"; |
| 1640 |
pub const szOID_FRESHEST_CRL: &'static str = "2.5.29.46"; |
| 1641 |
pub const szOID_NAME_CONSTRAINTS: &'static str = "2.5.29.30"; |
| 1642 |
pub const szOID_POLICY_MAPPINGS: &'static str = "2.5.29.33"; |
| 1643 |
pub const szOID_LEGACY_POLICY_MAPPINGS: &'static str = "2.5.29.5"; |
| 1644 |
pub const szOID_POLICY_CONSTRAINTS: &'static str = "2.5.29.36"; |
| 1645 |
pub const szOID_RENEWAL_CERTIFICATE: &'static str = "1.3.6.1.4.1.311.13.1"; |
| 1646 |
pub const szOID_ENROLLMENT_NAME_VALUE_PAIR: &'static str = "1.3.6.1.4.1.311.13.2.1"; |
| 1647 |
pub const szOID_ENROLLMENT_CSP_PROVIDER: &'static str = "1.3.6.1.4.1.311.13.2.2"; |
| 1648 |
pub const szOID_OS_VERSION: &'static str = "1.3.6.1.4.1.311.13.2.3"; |
| 1649 |
pub const szOID_ENROLLMENT_AGENT: &'static str = "1.3.6.1.4.1.311.20.2.1"; |
| 1650 |
pub const szOID_PKIX: &'static str = "1.3.6.1.5.5.7"; |
| 1651 |
pub const szOID_PKIX_PE: &'static str = "1.3.6.1.5.5.7.1"; |
| 1652 |
pub const szOID_AUTHORITY_INFO_ACCESS: &'static str = "1.3.6.1.5.5.7.1.1"; |
| 1653 |
pub const szOID_SUBJECT_INFO_ACCESS: &'static str = "1.3.6.1.5.5.7.1.11"; |
| 1654 |
pub const szOID_BIOMETRIC_EXT: &'static str = "1.3.6.1.5.5.7.1.2"; |
| 1655 |
pub const szOID_QC_STATEMENTS_EXT: &'static str = "1.3.6.1.5.5.7.1.3"; |
| 1656 |
pub const szOID_LOGOTYPE_EXT: &'static str = "1.3.6.1.5.5.7.1.12"; |
| 1657 |
pub const szOID_TLS_FEATURES_EXT: &'static str = "1.3.6.1.5.5.7.1.24"; |
| 1658 |
pub const szOID_CERT_EXTENSIONS: &'static str = "1.3.6.1.4.1.311.2.1.14"; |
| 1659 |
pub const szOID_NEXT_UPDATE_LOCATION: &'static str = "1.3.6.1.4.1.311.10.2"; |
| 1660 |
pub const szOID_REMOVE_CERTIFICATE: &'static str = "1.3.6.1.4.1.311.10.8.1"; |
| 1661 |
pub const szOID_CROSS_CERT_DIST_POINTS: &'static str = "1.3.6.1.4.1.311.10.9.1"; |
| 1662 |
pub const szOID_CTL: &'static str = "1.3.6.1.4.1.311.10.1"; |
| 1663 |
pub const szOID_SORTED_CTL: &'static str = "1.3.6.1.4.1.311.10.1.1"; |
| 1664 |
pub const szOID_SERIALIZED: &'static str = "1.3.6.1.4.1.311.10.3.3.1"; |
| 1665 |
pub const szOID_NT_PRINCIPAL_NAME: &'static str = "1.3.6.1.4.1.311.20.2.3"; |
| 1666 |
pub const szOID_INTERNATIONALIZED_EMAIL_ADDRESS: &'static str = "1.3.6.1.4.1.311.20.2.4"; |
| 1667 |
pub const szOID_PRODUCT_UPDATE: &'static str = "1.3.6.1.4.1.311.31.1"; |
| 1668 |
pub const szOID_ANY_APPLICATION_POLICY: &'static str = "1.3.6.1.4.1.311.10.12.1"; |
| 1669 |
pub const szOID_AUTO_ENROLL_CTL_USAGE: &'static str = "1.3.6.1.4.1.311.20.1"; |
| 1670 |
pub const szOID_ENROLL_CERTTYPE_EXTENSION: &'static str = "1.3.6.1.4.1.311.20.2"; |
| 1671 |
pub const szOID_CERT_MANIFOLD: &'static str = "1.3.6.1.4.1.311.20.3"; |
| 1672 |
pub const szOID_CERTSRV_CA_VERSION: &'static str = "1.3.6.1.4.1.311.21.1"; |
| 1673 |
pub const szOID_CERTSRV_PREVIOUS_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.2"; |
| 1674 |
pub const szOID_CRL_VIRTUAL_BASE: &'static str = "1.3.6.1.4.1.311.21.3"; |
| 1675 |
pub const szOID_CRL_NEXT_PUBLISH: &'static str = "1.3.6.1.4.1.311.21.4"; |
| 1676 |
pub const szOID_KP_CA_EXCHANGE: &'static str = "1.3.6.1.4.1.311.21.5"; |
| 1677 |
pub const szOID_KP_PRIVACY_CA: &'static str = "1.3.6.1.4.1.311.21.36"; |
| 1678 |
pub const szOID_KP_KEY_RECOVERY_AGENT: &'static str = "1.3.6.1.4.1.311.21.6"; |
| 1679 |
pub const szOID_CERTIFICATE_TEMPLATE: &'static str = "1.3.6.1.4.1.311.21.7"; |
| 1680 |
pub const szOID_ENTERPRISE_OID_ROOT: &'static str = "1.3.6.1.4.1.311.21.8"; |
| 1681 |
pub const szOID_RDN_DUMMY_SIGNER: &'static str = "1.3.6.1.4.1.311.21.9"; |
| 1682 |
pub const szOID_APPLICATION_CERT_POLICIES: &'static str = "1.3.6.1.4.1.311.21.10"; |
| 1683 |
pub const szOID_APPLICATION_POLICY_MAPPINGS: &'static str = "1.3.6.1.4.1.311.21.11"; |
| 1684 |
pub const szOID_APPLICATION_POLICY_CONSTRAINTS: &'static str = "1.3.6.1.4.1.311.21.12"; |
| 1685 |
pub const szOID_ARCHIVED_KEY_ATTR: &'static str = "1.3.6.1.4.1.311.21.13"; |
| 1686 |
pub const szOID_CRL_SELF_CDP: &'static str = "1.3.6.1.4.1.311.21.14"; |
| 1687 |
pub const szOID_REQUIRE_CERT_CHAIN_POLICY: &'static str = "1.3.6.1.4.1.311.21.15"; |
| 1688 |
pub const szOID_ARCHIVED_KEY_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.16"; |
| 1689 |
pub const szOID_ISSUED_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.17"; |
| 1690 |
pub const szOID_DS_EMAIL_REPLICATION: &'static str = "1.3.6.1.4.1.311.21.19"; |
| 1691 |
pub const szOID_REQUEST_CLIENT_INFO: &'static str = "1.3.6.1.4.1.311.21.20"; |
| 1692 |
pub const szOID_ENCRYPTED_KEY_HASH: &'static str = "1.3.6.1.4.1.311.21.21"; |
| 1693 |
pub const szOID_CERTSRV_CROSSCA_VERSION: &'static str = "1.3.6.1.4.1.311.21.22"; |
| 1694 |
pub const szOID_NTDS_REPLICATION: &'static str = "1.3.6.1.4.1.311.25.1"; |
| 1695 |
pub const szOID_SUBJECT_DIR_ATTRS: &'static str = "2.5.29.9"; |
| 1696 |
pub const szOID_PKIX_KP: &'static str = "1.3.6.1.5.5.7.3"; |
| 1697 |
pub const szOID_PKIX_KP_SERVER_AUTH: &'static str = "1.3.6.1.5.5.7.3.1"; |
| 1698 |
pub const szOID_PKIX_KP_CLIENT_AUTH: &'static str = "1.3.6.1.5.5.7.3.2"; |
| 1699 |
pub const szOID_PKIX_KP_CODE_SIGNING: &'static str = "1.3.6.1.5.5.7.3.3"; |
| 1700 |
pub const szOID_PKIX_KP_EMAIL_PROTECTION: &'static str = "1.3.6.1.5.5.7.3.4"; |
| 1701 |
pub const szOID_PKIX_KP_IPSEC_END_SYSTEM: &'static str = "1.3.6.1.5.5.7.3.5"; |
| 1702 |
pub const szOID_PKIX_KP_IPSEC_TUNNEL: &'static str = "1.3.6.1.5.5.7.3.6"; |
| 1703 |
pub const szOID_PKIX_KP_IPSEC_USER: &'static str = "1.3.6.1.5.5.7.3.7"; |
| 1704 |
pub const szOID_PKIX_KP_TIMESTAMP_SIGNING: &'static str = "1.3.6.1.5.5.7.3.8"; |
| 1705 |
pub const szOID_PKIX_KP_OCSP_SIGNING: &'static str = "1.3.6.1.5.5.7.3.9"; |
| 1706 |
pub const szOID_PKIX_OCSP_NOCHECK: &'static str = "1.3.6.1.5.5.7.48.1.5"; |
| 1707 |
pub const szOID_PKIX_OCSP_NONCE: &'static str = "1.3.6.1.5.5.7.48.1.2"; |
| 1708 |
pub const szOID_IPSEC_KP_IKE_INTERMEDIATE: &'static str = "1.3.6.1.5.5.8.2.2"; |
| 1709 |
pub const szOID_PKINIT_KP_KDC: &'static str = "1.3.6.1.5.2.3.5"; |
| 1710 |
pub const szOID_KP_CTL_USAGE_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.1"; |
| 1711 |
pub const szOID_KP_TIME_STAMP_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.2"; |
| 1712 |
pub const szOID_SERVER_GATED_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.3"; |
| 1713 |
pub const szOID_SGC_NETSCAPE: &'static str = "2.16.840.1.113730.4.1"; |
| 1714 |
pub const szOID_KP_EFS: &'static str = "1.3.6.1.4.1.311.10.3.4"; |
| 1715 |
pub const szOID_EFS_RECOVERY: &'static str = "1.3.6.1.4.1.311.10.3.4.1"; |
| 1716 |
pub const szOID_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.5"; |
| 1717 |
pub const szOID_ATTEST_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.5.1"; |
| 1718 |
pub const szOID_NT5_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.6"; |
| 1719 |
pub const szOID_OEM_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.7"; |
| 1720 |
pub const szOID_EMBEDDED_NT_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.8"; |
| 1721 |
pub const szOID_ROOT_LIST_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.9"; |
| 1722 |
pub const szOID_KP_QUALIFIED_SUBORDINATION: &'static str = "1.3.6.1.4.1.311.10.3.10"; |
| 1723 |
pub const szOID_KP_KEY_RECOVERY: &'static str = "1.3.6.1.4.1.311.10.3.11"; |
| 1724 |
pub const szOID_KP_DOCUMENT_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.12"; |
| 1725 |
pub const szOID_KP_LIFETIME_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.13"; |
| 1726 |
pub const szOID_KP_MOBILE_DEVICE_SOFTWARE: &'static str = "1.3.6.1.4.1.311.10.3.14"; |
| 1727 |
pub const szOID_KP_SMART_DISPLAY: &'static str = "1.3.6.1.4.1.311.10.3.15"; |
| 1728 |
pub const szOID_KP_CSP_SIGNATURE: &'static str = "1.3.6.1.4.1.311.10.3.16"; |
| 1729 |
pub const szOID_KP_FLIGHT_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.27"; |
| 1730 |
pub const szOID_PLATFORM_MANIFEST_BINARY_ID: &'static str = "1.3.6.1.4.1.311.10.3.28"; |
| 1731 |
pub const szOID_DRM: &'static str = "1.3.6.1.4.1.311.10.5.1"; |
| 1732 |
pub const szOID_DRM_INDIVIDUALIZATION: &'static str = "1.3.6.1.4.1.311.10.5.2"; |
| 1733 |
pub const szOID_LICENSES: &'static str = "1.3.6.1.4.1.311.10.6.1"; |
| 1734 |
pub const szOID_LICENSE_SERVER: &'static str = "1.3.6.1.4.1.311.10.6.2"; |
| 1735 |
pub const szOID_KP_SMARTCARD_LOGON: &'static str = "1.3.6.1.4.1.311.20.2.2"; |
| 1736 |
pub const szOID_KP_KERNEL_MODE_CODE_SIGNING: &'static str = "1.3.6.1.4.1.311.61.1.1"; |
| 1737 |
pub const szOID_KP_KERNEL_MODE_TRUSTED_BOOT_SIGNING: &'static str = "1.3.6.1.4.1.311.61.4.1"; |
| 1738 |
pub const szOID_REVOKED_LIST_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.19"; |
| 1739 |
pub const szOID_WINDOWS_KITS_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.20"; |
| 1740 |
pub const szOID_WINDOWS_RT_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.21"; |
| 1741 |
pub const szOID_PROTECTED_PROCESS_LIGHT_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.22"; |
| 1742 |
pub const szOID_WINDOWS_TCB_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.23"; |
| 1743 |
pub const szOID_PROTECTED_PROCESS_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.24"; |
| 1744 |
pub const szOID_WINDOWS_THIRD_PARTY_COMPONENT_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.25"; |
| 1745 |
pub const szOID_WINDOWS_SOFTWARE_EXTENSION_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.26"; |
| 1746 |
pub const szOID_DISALLOWED_LIST: &'static str = "1.3.6.1.4.1.311.10.3.30"; |
| 1747 |
pub const szOID_PIN_RULES_SIGNER: &'static str = "1.3.6.1.4.1.311.10.3.31"; |
| 1748 |
pub const szOID_PIN_RULES_CTL: &'static str = "1.3.6.1.4.1.311.10.3.32"; |
| 1749 |
pub const szOID_PIN_RULES_EXT: &'static str = "1.3.6.1.4.1.311.10.3.33"; |
| 1750 |
pub const szOID_PIN_RULES_DOMAIN_NAME: &'static str = "1.3.6.1.4.1.311.10.3.34"; |
| 1751 |
pub const szOID_PIN_RULES_LOG_END_DATE_EXT: &'static str = "1.3.6.1.4.1.311.10.3.35"; |
| 1752 |
pub const szOID_IUM_SIGNING: &'static str = "1.3.6.1.4.1.311.10.3.37"; |
| 1753 |
pub const szOID_EV_WHQL_CRYPTO: &'static str = "1.3.6.1.4.1.311.10.3.39"; |
| 1754 |
pub const szOID_SYNC_ROOT_CTL_EXT: &'static str = "1.3.6.1.4.1.311.10.3.50"; |
| 1755 |
pub const szOID_HPKP_DOMAIN_NAME_CTL: &'static str = "1.3.6.1.4.1.311.10.3.60"; |
| 1756 |
pub const szOID_HPKP_HEADER_VALUE_CTL: &'static str = "1.3.6.1.4.1.311.10.3.61"; |
| 1757 |
pub const szOID_KP_KERNEL_MODE_HAL_EXTENSION_SIGNING: &'static str = "1.3.6.1.4.1.311.61.5.1"; |
| 1758 |
pub const szOID_WINDOWS_STORE_SIGNER: &'static str = "1.3.6.1.4.1.311.76.3.1"; |
| 1759 |
pub const szOID_DYNAMIC_CODE_GEN_SIGNER: &'static str = "1.3.6.1.4.1.311.76.5.1"; |
| 1760 |
pub const szOID_MICROSOFT_PUBLISHER_SIGNER: &'static str = "1.3.6.1.4.1.311.76.8.1"; |
| 1761 |
pub const szOID_YESNO_TRUST_ATTR: &'static str = "1.3.6.1.4.1.311.10.4.1"; |
| 1762 |
pub const szOID_SITE_PIN_RULES_INDEX_ATTR: &'static str = "1.3.6.1.4.1.311.10.4.2"; |
| 1763 |
pub const szOID_SITE_PIN_RULES_FLAGS_ATTR: &'static str = "1.3.6.1.4.1.311.10.4.3"; |
| 1764 |
pub const szOID_PKIX_POLICY_QUALIFIER_CPS: &'static str = "1.3.6.1.5.5.7.2.1"; |
| 1765 |
pub const szOID_PKIX_POLICY_QUALIFIER_USERNOTICE: &'static str = "1.3.6.1.5.5.7.2.2"; |
| 1766 |
pub const szOID_ROOT_PROGRAM_FLAGS: &'static str = "1.3.6.1.4.1.311.60.1.1"; |
| 1767 |
pub const CERT_ROOT_PROGRAM_FLAG_ORG: DWORD = 0x80; |
| 1768 |
pub const CERT_ROOT_PROGRAM_FLAG_LSC: DWORD = 0x40; |
| 1769 |
pub const CERT_ROOT_PROGRAM_FLAG_SUBJECT_LOGO: DWORD = 0x20; |
| 1770 |
pub const CERT_ROOT_PROGRAM_FLAG_OU: DWORD = 0x10; |
| 1771 |
pub const CERT_ROOT_PROGRAM_FLAG_ADDRESS: DWORD = 0x08; |
| 1772 |
pub const szOID_CERT_POLICIES_95_QUALIFIER1: &'static str = "2.16.840.1.113733.1.7.1.1"; |
| 1773 |
pub const szOID_RDN_TPM_MANUFACTURER: &'static str = "2.23.133.2.1"; |
| 1774 |
pub const szOID_RDN_TPM_MODEL: &'static str = "2.23.133.2.2"; |
| 1775 |
pub const szOID_RDN_TPM_VERSION: &'static str = "2.23.133.2.3"; |
| 1776 |
pub const szOID_RDN_TCG_PLATFORM_MANUFACTURER: &'static str = "2.23.133.2.4"; |
| 1777 |
pub const szOID_RDN_TCG_PLATFORM_MODEL: &'static str = "2.23.133.2.5"; |
| 1778 |
pub const szOID_RDN_TCG_PLATFORM_VERSION: &'static str = "2.23.133.2.6"; |
| 1779 |
pub const szOID_ENROLL_EK_INFO: &'static str = "1.3.6.1.4.1.311.21.23"; |
| 1780 |
pub const szOID_ENROLL_AIK_INFO: &'static str = "1.3.6.1.4.1.311.21.39"; |
| 1781 |
pub const szOID_ENROLL_ATTESTATION_STATEMENT: &'static str = "1.3.6.1.4.1.311.21.24"; |
| 1782 |
pub const szOID_ENROLL_KSP_NAME: &'static str = "1.3.6.1.4.1.311.21.25"; |
| 1783 |
pub const szOID_ENROLL_EKPUB_CHALLENGE: &'static str = "1.3.6.1.4.1.311.21.26"; |
| 1784 |
pub const szOID_ENROLL_CAXCHGCERT_HASH: &'static str = "1.3.6.1.4.1.311.21.27"; |
| 1785 |
pub const szOID_ENROLL_ATTESTATION_CHALLENGE: &'static str = "1.3.6.1.4.1.311.21.28"; |
| 1786 |
pub const szOID_ENROLL_ENCRYPTION_ALGORITHM: &'static str = "1.3.6.1.4.1.311.21.29"; |
| 1787 |
pub const szOID_KP_TPM_EK_CERTIFICATE: &'static str = "2.23.133.8.1"; |
| 1788 |
pub const szOID_KP_TPM_PLATFORM_CERTIFICATE: &'static str = "2.23.133.8.2"; |
| 1789 |
pub const szOID_KP_TPM_AIK_CERTIFICATE: &'static str = "2.23.133.8.3"; |
| 1790 |
pub const szOID_ENROLL_EKVERIFYKEY: &'static str = "1.3.6.1.4.1.311.21.30"; |
| 1791 |
pub const szOID_ENROLL_EKVERIFYCERT: &'static str = "1.3.6.1.4.1.311.21.31"; |
| 1792 |
pub const szOID_ENROLL_EKVERIFYCREDS: &'static str = "1.3.6.1.4.1.311.21.32"; |
| 1793 |
pub const szOID_ENROLL_SCEP_ERROR: &'static str = "1.3.6.1.4.1.311.21.33"; |
| 1794 |
pub const szOID_ENROLL_SCEP_SERVER_STATE: &'static str = "1.3.6.1.4.1.311.21.34"; |
| 1795 |
pub const szOID_ENROLL_SCEP_CHALLENGE_ANSWER: &'static str = "1.3.6.1.4.1.311.21.35"; |
| 1796 |
pub const szOID_ENROLL_SCEP_CLIENT_REQUEST: &'static str = "1.3.6.1.4.1.311.21.37"; |
| 1797 |
pub const szOID_ENROLL_SCEP_SERVER_MESSAGE: &'static str = "1.3.6.1.4.1.311.21.38"; |
| 1798 |
pub const szOID_ENROLL_SCEP_SERVER_SECRET: &'static str = "1.3.6.1.4.1.311.21.40"; |
| 1799 |
pub const szOID_ENROLL_KEY_AFFINITY: &'static str = "1.3.6.1.4.1.311.21.41"; |
| 1800 |
pub const szOID_ENROLL_SCEP_SIGNER_HASH: &'static str = "1.3.6.1.4.1.311.21.42"; |
| 1801 |
pub const szOID_ENROLL_EK_CA_KEYID: &'static str = "1.3.6.1.4.1.311.21.43"; |
| 1802 |
pub const szOID_ATTR_SUPPORTED_ALGORITHMS: &'static str = "2.5.4.52"; |
| 1803 |
pub const szOID_ATTR_TPM_SPECIFICATION: &'static str = "2.23.133.2.16"; |
| 1804 |
pub const szOID_ATTR_PLATFORM_SPECIFICATION: &'static str = "2.23.133.2.17"; |
| 1805 |
pub const szOID_ATTR_TPM_SECURITY_ASSERTIONS: &'static str = "2.23.133.2.18"; |
| 1806 |
STRUCT!{struct CERT_EXTENSIONS { |
| 1807 |
cExtension: DWORD, |
| 1808 |
rgExtension: PCERT_EXTENSION, |
| 1809 |
}} |
| 1810 |
pub type PCERT_EXTENSIONS = *mut CERT_EXTENSIONS; |
| 1811 |
pub const CERT_UNICODE_RDN_ERR_INDEX_MASK: DWORD = 0x3FF; |
| 1812 |
pub const CERT_UNICODE_RDN_ERR_INDEX_SHIFT: DWORD = 22; |
| 1813 |
pub const CERT_UNICODE_ATTR_ERR_INDEX_MASK: DWORD = 0x003F; |
| 1814 |
pub const CERT_UNICODE_ATTR_ERR_INDEX_SHIFT: DWORD = 16; |
| 1815 |
pub const CERT_UNICODE_VALUE_ERR_INDEX_MASK: DWORD = 0x0000FFFF; |
| 1816 |
pub const CERT_UNICODE_VALUE_ERR_INDEX_SHIFT: DWORD = 0; |
| 1817 |
#[inline] |
| 1818 |
pub fn GET_CERT_UNICODE_RDN_ERR_INDEX(X: DWORD) -> DWORD { |
| 1819 |
(X >> CERT_UNICODE_RDN_ERR_INDEX_SHIFT) & CERT_UNICODE_RDN_ERR_INDEX_MASK |
| 1820 |
} |
| 1821 |
#[inline] |
| 1822 |
pub fn GET_CERT_UNICODE_ATTR_ERR_INDEX(X: DWORD) -> DWORD { |
| 1823 |
(X >> CERT_UNICODE_ATTR_ERR_INDEX_SHIFT) & CERT_UNICODE_ATTR_ERR_INDEX_MASK |
| 1824 |
} |
| 1825 |
#[inline] |
| 1826 |
pub fn GET_CERT_UNICODE_VALUE_ERR_INDEX(X: DWORD) -> DWORD { |
| 1827 |
X & CERT_UNICODE_VALUE_ERR_INDEX_MASK |
| 1828 |
} |
| 1829 |
STRUCT!{struct CERT_AUTHORITY_KEY_ID_INFO { |
| 1830 |
KeyId: CRYPT_DATA_BLOB, |
| 1831 |
CertIssuer: CERT_NAME_BLOB, |
| 1832 |
CertSerialNumber: CRYPT_INTEGER_BLOB, |
| 1833 |
}} |
| 1834 |
pub type PCERT_AUTHORITY_KEY_ID_INFO = *mut CERT_AUTHORITY_KEY_ID_INFO; |
| 1835 |
STRUCT!{struct CERT_PRIVATE_KEY_VALIDITY { |
| 1836 |
NotBefore: FILETIME, |
| 1837 |
NotAfter: FILETIME, |
| 1838 |
}} |
| 1839 |
pub type PCERT_PRIVATE_KEY_VALIDITY = *mut CERT_PRIVATE_KEY_VALIDITY; |
| 1840 |
STRUCT!{struct CERT_KEY_ATTRIBUTES_INFO { |
| 1841 |
KeyId: CRYPT_DATA_BLOB, |
| 1842 |
IntendedKeyUsage: CRYPT_BIT_BLOB, |
| 1843 |
pPrivateKeyUsagePeriod: PCERT_PRIVATE_KEY_VALIDITY, |
| 1844 |
}} |
| 1845 |
pub type PCERT_KEY_ATTRIBUTES_INFO = *mut CERT_KEY_ATTRIBUTES_INFO; |
| 1846 |
pub const CERT_DIGITAL_SIGNATURE_KEY_USAGE: DWORD = 0x80; |
| 1847 |
pub const CERT_NON_REPUDIATION_KEY_USAGE: DWORD = 0x40; |
| 1848 |
pub const CERT_KEY_ENCIPHERMENT_KEY_USAGE: DWORD = 0x20; |
| 1849 |
pub const CERT_DATA_ENCIPHERMENT_KEY_USAGE: DWORD = 0x10; |
| 1850 |
pub const CERT_KEY_AGREEMENT_KEY_USAGE: DWORD = 0x08; |
| 1851 |
pub const CERT_KEY_CERT_SIGN_KEY_USAGE: DWORD = 0x04; |
| 1852 |
pub const CERT_OFFLINE_CRL_SIGN_KEY_USAGE: DWORD = 0x02; |
| 1853 |
pub const CERT_CRL_SIGN_KEY_USAGE: DWORD = 0x02; |
| 1854 |
pub const CERT_ENCIPHER_ONLY_KEY_USAGE: DWORD = 0x01; |
| 1855 |
pub const CERT_DECIPHER_ONLY_KEY_USAGE: DWORD = 0x80; |
| 1856 |
STRUCT!{struct CERT_POLICY_ID { |
| 1857 |
cCertPolicyElementId: DWORD, |
| 1858 |
rgpszCertPolicyElementId: *mut LPSTR, |
| 1859 |
}} |
| 1860 |
pub type PCERT_POLICY_ID = *mut CERT_POLICY_ID; |
| 1861 |
STRUCT!{struct CERT_KEY_USAGE_RESTRICTION_INFO { |
| 1862 |
cCertPolicyId: DWORD, |
| 1863 |
rgCertPolicyId: PCERT_POLICY_ID, |
| 1864 |
RestrictedKeyUsage: CRYPT_BIT_BLOB, |
| 1865 |
}} |
| 1866 |
pub type PCERT_KEY_USAGE_RESTRICTION_INFO = *mut CERT_KEY_USAGE_RESTRICTION_INFO; |
| 1867 |
STRUCT!{struct CERT_OTHER_NAME { |
| 1868 |
pszObjId: LPSTR, |
| 1869 |
Value: CRYPT_OBJID_BLOB, |
| 1870 |
}} |
| 1871 |
pub type PCERT_OTHER_NAME = *mut CERT_OTHER_NAME; |
| 1872 |
UNION!{union CERT_ALT_NAME_ENTRY_u { |
| 1873 |
[usize; 2], |
| 1874 |
pOtherName pOtherName_mut: PCERT_OTHER_NAME, |
| 1875 |
pwszRfc822Name pwszRfc822Name_mut: LPWSTR, |
| 1876 |
pwszDNSName pwszDNSName_mut: LPWSTR, |
| 1877 |
DirectoryName DirectoryName_mut: CERT_NAME_BLOB, |
| 1878 |
pwszURL pwszURL_mut: LPWSTR, |
| 1879 |
IPAddress IPAddress_mut: CRYPT_DATA_BLOB, |
| 1880 |
pszRegisteredID pszRegisteredID_mut: LPSTR, |
| 1881 |
}} |
| 1882 |
STRUCT!{struct CERT_ALT_NAME_ENTRY { |
| 1883 |
dwAltNameChoice: DWORD, |
| 1884 |
u: CERT_ALT_NAME_ENTRY_u, |
| 1885 |
}} |
| 1886 |
pub type PCERT_ALT_NAME_ENTRY = *mut CERT_ALT_NAME_ENTRY; |
| 1887 |
pub const CERT_ALT_NAME_OTHER_NAME: DWORD = 1; |
| 1888 |
pub const CERT_ALT_NAME_RFC822_NAME: DWORD = 2; |
| 1889 |
pub const CERT_ALT_NAME_DNS_NAME: DWORD = 3; |
| 1890 |
pub const CERT_ALT_NAME_X400_ADDRESS: DWORD = 4; |
| 1891 |
pub const CERT_ALT_NAME_DIRECTORY_NAME: DWORD = 5; |
| 1892 |
pub const CERT_ALT_NAME_EDI_PARTY_NAME: DWORD = 6; |
| 1893 |
pub const CERT_ALT_NAME_URL: DWORD = 7; |
| 1894 |
pub const CERT_ALT_NAME_IP_ADDRESS: DWORD = 8; |
| 1895 |
pub const CERT_ALT_NAME_REGISTERED_ID: DWORD = 9; |
| 1896 |
STRUCT!{struct CERT_ALT_NAME_INFO { |
| 1897 |
cAltEntry: DWORD, |
| 1898 |
rgAltEntry: PCERT_ALT_NAME_ENTRY, |
| 1899 |
}} |
| 1900 |
pub type PCERT_ALT_NAME_INFO = *mut CERT_ALT_NAME_INFO; |
| 1901 |
pub const CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK: DWORD = 0xFF; |
| 1902 |
pub const CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT: DWORD = 16; |
| 1903 |
pub const CERT_ALT_NAME_VALUE_ERR_INDEX_MASK: DWORD = 0x0000FFFF; |
| 1904 |
pub const CERT_ALT_NAME_VALUE_ERR_INDEX_SHIFT: DWORD = 0; |
| 1905 |
#[inline] |
| 1906 |
pub fn GET_CERT_ALT_NAME_ENTRY_ERR_INDEX(X: DWORD) -> DWORD { |
| 1907 |
(X >> CERT_ALT_NAME_ENTRY_ERR_INDEX_SHIFT) & CERT_ALT_NAME_ENTRY_ERR_INDEX_MASK |
| 1908 |
} |
| 1909 |
#[inline] |
| 1910 |
pub fn GET_CERT_ALT_NAME_VALUE_ERR_INDEX(X: DWORD) -> DWORD { |
| 1911 |
X & CERT_ALT_NAME_VALUE_ERR_INDEX_MASK |
| 1912 |
} |
| 1913 |
STRUCT!{struct CERT_BASIC_CONSTRAINTS_INFO { |
| 1914 |
SubjectType: CRYPT_BIT_BLOB, |
| 1915 |
fPathLenConstraint: BOOL, |
| 1916 |
dwPathLenConstraint: DWORD, |
| 1917 |
cSubtreesConstraint: DWORD, |
| 1918 |
rgSubtreesConstraint: *mut CERT_NAME_BLOB, |
| 1919 |
}} |
| 1920 |
pub type PCERT_BASIC_CONSTRAINTS_INFO = *mut CERT_BASIC_CONSTRAINTS_INFO; |
| 1921 |
pub const CERT_CA_SUBJECT_FLAG: DWORD = 0x80; |
| 1922 |
pub const CERT_END_ENTITY_SUBJECT_FLAG: DWORD = 0x40; |
| 1923 |
STRUCT!{struct CERT_BASIC_CONSTRAINTS2_INFO { |
| 1924 |
fCA: BOOL, |
| 1925 |
fPathLenConstraint: BOOL, |
| 1926 |
dwPathLenConstraint: DWORD, |
| 1927 |
}} |
| 1928 |
pub type PCERT_BASIC_CONSTRAINTS2_INFO = *mut CERT_BASIC_CONSTRAINTS2_INFO; |
| 1929 |
STRUCT!{struct CERT_POLICY_QUALIFIER_INFO { |
| 1930 |
pszPolicyQualifierId: LPSTR, |
| 1931 |
Qualifier: CRYPT_OBJID_BLOB, |
| 1932 |
}} |
| 1933 |
pub type PCERT_POLICY_QUALIFIER_INFO = *mut CERT_POLICY_QUALIFIER_INFO; |
| 1934 |
STRUCT!{struct CERT_POLICY_INFO { |
| 1935 |
pszPolicyIdentifier: LPSTR, |
| 1936 |
cPolicyQualifier: DWORD, |
| 1937 |
rgPolicyQualifier: *mut CERT_POLICY_QUALIFIER_INFO, |
| 1938 |
}} |
| 1939 |
pub type PCERT_POLICY_INFO = *mut CERT_POLICY_INFO; |
| 1940 |
STRUCT!{struct CERT_POLICIES_INFO { |
| 1941 |
cPolicyInfo: DWORD, |
| 1942 |
rgPolicyInfo: *mut CERT_POLICY_INFO, |
| 1943 |
}} |
| 1944 |
pub type PCERT_POLICIES_INFO = *mut CERT_POLICIES_INFO; |
| 1945 |
STRUCT!{struct CERT_POLICY_QUALIFIER_NOTICE_REFERENCE { |
| 1946 |
pszOrganization: LPSTR, |
| 1947 |
cNoticeNumbers: DWORD, |
| 1948 |
rgNoticeNumbers: *mut c_int, |
| 1949 |
}} |
| 1950 |
pub type PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE = *mut CERT_POLICY_QUALIFIER_NOTICE_REFERENCE; |
| 1951 |
STRUCT!{struct CERT_POLICY_QUALIFIER_USER_NOTICE { |
| 1952 |
pNoticeReference: *mut CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, |
| 1953 |
pszDisplayText: LPWSTR, |
| 1954 |
}} |
| 1955 |
pub type PCERT_POLICY_QUALIFIER_USER_NOTICE = *mut CERT_POLICY_QUALIFIER_USER_NOTICE; |
| 1956 |
STRUCT!{struct CPS_URLS { |
| 1957 |
pszURL: LPWSTR, |
| 1958 |
pAlgorithm: *mut CRYPT_ALGORITHM_IDENTIFIER, |
| 1959 |
pDigest: *mut CRYPT_DATA_BLOB, |
| 1960 |
}} |
| 1961 |
pub type PCPS_URLS = *mut CPS_URLS; |
| 1962 |
STRUCT!{struct CERT_POLICY95_QUALIFIER1 { |
| 1963 |
pszPracticesReference: LPWSTR, |
| 1964 |
pszNoticeIdentifier: LPSTR, |
| 1965 |
pszNSINoticeIdentifier: LPSTR, |
| 1966 |
cCPSURLs: DWORD, |
| 1967 |
rgCPSURLs: *mut CPS_URLS, |
| 1968 |
}} |
| 1969 |
pub type PCERT_POLICY95_QUALIFIER1 = *mut CERT_POLICY95_QUALIFIER1; |
| 1970 |
STRUCT!{struct CERT_POLICY_MAPPING { |
| 1971 |
pszIssuerDomainPolicy: LPSTR, |
| 1972 |
pszSubjectDomainPolicy: LPSTR, |
| 1973 |
}} |
| 1974 |
pub type PCERT_POLICY_MAPPING = *mut CERT_POLICY_MAPPING; |
| 1975 |
STRUCT!{struct CERT_POLICY_MAPPINGS_INFO { |
| 1976 |
cPolicyMapping: DWORD, |
| 1977 |
rgPolicyMapping: PCERT_POLICY_MAPPING, |
| 1978 |
}} |
| 1979 |
pub type PCERT_POLICY_MAPPINGS_INFO = *mut CERT_POLICY_MAPPINGS_INFO; |
| 1980 |
STRUCT!{struct CERT_POLICY_CONSTRAINTS_INFO { |
| 1981 |
fRequireExplicitPolicy: BOOL, |
| 1982 |
dwRequireExplicitPolicySkipCerts: DWORD, |
| 1983 |
fInhibitPolicyMapping: BOOL, |
| 1984 |
dwInhibitPolicyMappingSkipCerts: DWORD, |
| 1985 |
}} |
| 1986 |
pub type PCERT_POLICY_CONSTRAINTS_INFO = *mut CERT_POLICY_CONSTRAINTS_INFO; |
| 1987 |
STRUCT!{struct CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY { |
| 1988 |
pszObjId: LPSTR, |
| 1989 |
cValue: DWORD, |
| 1990 |
rgValue: PCRYPT_DER_BLOB, |
| 1991 |
}} |
| 1992 |
pub type PCRYPT_CONTENT_INFO_SEQUENCE_OF_ANY = *mut CRYPT_CONTENT_INFO_SEQUENCE_OF_ANY; |
| 1993 |
STRUCT!{struct CRYPT_CONTENT_INFO { |
| 1994 |
pszObjId: LPSTR, |
| 1995 |
Content: CRYPT_DER_BLOB, |
| 1996 |
}} |
| 1997 |
pub type PCRYPT_CONTENT_INFO = *mut CRYPT_CONTENT_INFO; |
| 1998 |
STRUCT!{struct CRYPT_SEQUENCE_OF_ANY { |
| 1999 |
cValue: DWORD, |
| 2000 |
rgValue: PCRYPT_DER_BLOB, |
| 2001 |
}} |
| 2002 |
pub type PCRYPT_SEQUENCE_OF_ANY = *mut CRYPT_SEQUENCE_OF_ANY; |
| 2003 |
STRUCT!{struct CERT_AUTHORITY_KEY_ID2_INFO { |
| 2004 |
KeyId: CRYPT_DATA_BLOB, |
| 2005 |
AuthorityCertIssuer: CERT_ALT_NAME_INFO, |
| 2006 |
AuthorityCertSerialNumber: CRYPT_INTEGER_BLOB, |
| 2007 |
}} |
| 2008 |
pub type PCERT_AUTHORITY_KEY_ID2_INFO = *mut CERT_AUTHORITY_KEY_ID2_INFO; |
| 2009 |
STRUCT!{struct CERT_ACCESS_DESCRIPTION { |
| 2010 |
pszAccessMethod: LPSTR, |
| 2011 |
AccessLocation: CERT_ALT_NAME_ENTRY, |
| 2012 |
}} |
| 2013 |
pub type PCERT_ACCESS_DESCRIPTION = *mut CERT_ACCESS_DESCRIPTION; |
| 2014 |
STRUCT!{struct CERT_AUTHORITY_INFO_ACCESS { |
| 2015 |
cAccDescr: DWORD, |
| 2016 |
rgAccDescr: PCERT_ACCESS_DESCRIPTION, |
| 2017 |
}} |
| 2018 |
pub type PCERT_AUTHORITY_INFO_ACCESS = *mut CERT_AUTHORITY_INFO_ACCESS; |
| 2019 |
pub type CERT_SUBJECT_INFO_ACCESS = CERT_AUTHORITY_INFO_ACCESS; |
| 2020 |
pub type PCERT_SUBJECT_INFO_ACCESS = *mut CERT_AUTHORITY_INFO_ACCESS; |
| 2021 |
pub const szOID_PKIX_ACC_DESCR: &'static str = "1.3.6.1.5.5.7.48"; |
| 2022 |
pub const szOID_PKIX_OCSP: &'static str = "1.3.6.1.5.5.7.48.1"; |
| 2023 |
pub const szOID_PKIX_CA_ISSUERS: &'static str = "1.3.6.1.5.5.7.48.2"; |
| 2024 |
pub const szOID_PKIX_TIME_STAMPING: &'static str = "1.3.6.1.5.5.7.48.3"; |
| 2025 |
pub const szOID_PKIX_CA_REPOSITORY: &'static str = "1.3.6.1.5.5.7.48.5"; |
| 2026 |
pub const CRL_REASON_UNSPECIFIED: DWORD = 0; |
| 2027 |
pub const CRL_REASON_KEY_COMPROMISE: DWORD = 1; |
| 2028 |
pub const CRL_REASON_CA_COMPROMISE: DWORD = 2; |
| 2029 |
pub const CRL_REASON_AFFILIATION_CHANGED: DWORD = 3; |
| 2030 |
pub const CRL_REASON_SUPERSEDED: DWORD = 4; |
| 2031 |
pub const CRL_REASON_CESSATION_OF_OPERATION: DWORD = 5; |
| 2032 |
pub const CRL_REASON_CERTIFICATE_HOLD: DWORD = 6; |
| 2033 |
pub const CRL_REASON_REMOVE_FROM_CRL: DWORD = 8; |
| 2034 |
pub const CRL_REASON_PRIVILEGE_WITHDRAWN: DWORD = 9; |
| 2035 |
pub const CRL_REASON_AA_COMPROMISE: DWORD = 10; |
| 2036 |
UNION!{union CRL_DIST_POINT_NAME_u { |
| 2037 |
[usize; 2], |
| 2038 |
FullName FullName_mut: CERT_ALT_NAME_INFO, |
| 2039 |
}} |
| 2040 |
STRUCT!{struct CRL_DIST_POINT_NAME { |
| 2041 |
dwDistPointNameChoice: DWORD, |
| 2042 |
u: CRL_DIST_POINT_NAME_u, |
| 2043 |
}} |
| 2044 |
pub type PCRL_DIST_POINT_NAME = *mut CRL_DIST_POINT_NAME; |
| 2045 |
pub const CRL_DIST_POINT_NO_NAME: DWORD = 0; |
| 2046 |
pub const CRL_DIST_POINT_FULL_NAME: DWORD = 1; |
| 2047 |
pub const CRL_DIST_POINT_ISSUER_RDN_NAME: DWORD = 2; |
| 2048 |
STRUCT!{struct CRL_DIST_POINT { |
| 2049 |
DistPointName: CRL_DIST_POINT_NAME, |
| 2050 |
ReasonFlags: CRYPT_BIT_BLOB, |
| 2051 |
CRLIssuer: CERT_ALT_NAME_INFO, |
| 2052 |
}} |
| 2053 |
pub type PCRL_DIST_POINT = *mut CRL_DIST_POINT; |
| 2054 |
pub const CRL_REASON_UNUSED_FLAG: DWORD = 0x80; |
| 2055 |
pub const CRL_REASON_KEY_COMPROMISE_FLAG: DWORD = 0x40; |
| 2056 |
pub const CRL_REASON_CA_COMPROMISE_FLAG: DWORD = 0x20; |
| 2057 |
pub const CRL_REASON_AFFILIATION_CHANGED_FLAG: DWORD = 0x10; |
| 2058 |
pub const CRL_REASON_SUPERSEDED_FLAG: DWORD = 0x08; |
| 2059 |
pub const CRL_REASON_CESSATION_OF_OPERATION_FLAG: DWORD = 0x04; |
| 2060 |
pub const CRL_REASON_CERTIFICATE_HOLD_FLAG: DWORD = 0x02; |
| 2061 |
pub const CRL_REASON_PRIVILEGE_WITHDRAWN_FLAG: DWORD = 0x01; |
| 2062 |
pub const CRL_REASON_AA_COMPROMISE_FLAG: DWORD = 0x80; |
| 2063 |
STRUCT!{struct CRL_DIST_POINTS_INFO { |
| 2064 |
cDistPoint: DWORD, |
| 2065 |
rgDistPoint: PCRL_DIST_POINT, |
| 2066 |
}} |
| 2067 |
pub type PCRL_DIST_POINTS_INFO = *mut CRL_DIST_POINTS_INFO; |
| 2068 |
pub const CRL_DIST_POINT_ERR_INDEX_MASK: DWORD = 0x7F; |
| 2069 |
pub const CRL_DIST_POINT_ERR_INDEX_SHIFT: DWORD = 24; |
| 2070 |
#[inline] |
| 2071 |
pub fn GET_CRL_DIST_POINT_ERR_INDEX(X: DWORD) -> DWORD { |
| 2072 |
(X >> CRL_DIST_POINT_ERR_INDEX_SHIFT) & CRL_DIST_POINT_ERR_INDEX_MASK |
| 2073 |
} |
| 2074 |
pub const CRL_DIST_POINT_ERR_CRL_ISSUER_BIT: DWORD = 0x80000000; |
| 2075 |
#[inline] |
| 2076 |
pub fn IS_CRL_DIST_POINT_ERR_CRL_ISSUER(X: DWORD) -> bool { |
| 2077 |
0 != (X & CRL_DIST_POINT_ERR_CRL_ISSUER_BIT) |
| 2078 |
} |
| 2079 |
STRUCT!{struct CROSS_CERT_DIST_POINTS_INFO { |
| 2080 |
dwSyncDeltaTime: DWORD, |
| 2081 |
cDistPoint: DWORD, |
| 2082 |
rgDistPoint: PCERT_ALT_NAME_INFO, |
| 2083 |
}} |
| 2084 |
pub type PCROSS_CERT_DIST_POINTS_INFO = *mut CROSS_CERT_DIST_POINTS_INFO; |
| 2085 |
pub const CROSS_CERT_DIST_POINT_ERR_INDEX_MASK: DWORD = 0xFF; |
| 2086 |
pub const CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT: DWORD = 24; |
| 2087 |
#[inline] |
| 2088 |
pub fn GET_CROSS_CERT_DIST_POINT_ERR_INDEX(X: DWORD) -> DWORD { |
| 2089 |
(X >> CROSS_CERT_DIST_POINT_ERR_INDEX_SHIFT) & CROSS_CERT_DIST_POINT_ERR_INDEX_MASK |
| 2090 |
} |
| 2091 |
STRUCT!{struct CERT_PAIR { |
| 2092 |
Forward: CERT_BLOB, |
| 2093 |
Reverse: CERT_BLOB, |
| 2094 |
}} |
| 2095 |
pub type PCERT_PAIR = *mut CERT_PAIR; |
| 2096 |
STRUCT!{struct CRL_ISSUING_DIST_POINT { |
| 2097 |
DistPointName: CRL_DIST_POINT_NAME, |
| 2098 |
fOnlyContainsUserCerts: BOOL, |
| 2099 |
fOnlyContainsCACerts: BOOL, |
| 2100 |
OnlySomeReasonFlags: CRYPT_BIT_BLOB, |
| 2101 |
fIndirectCRL: BOOL, |
| 2102 |
}} |
| 2103 |
pub type PCRL_ISSUING_DIST_POINT = *mut CRL_ISSUING_DIST_POINT; |
| 2104 |
STRUCT!{struct CERT_GENERAL_SUBTREE { |
| 2105 |
Base: CERT_ALT_NAME_ENTRY, |
| 2106 |
dwMinimum: DWORD, |
| 2107 |
fMaximum: BOOL, |
| 2108 |
dwMaximum: DWORD, |
| 2109 |
}} |
| 2110 |
pub type PCERT_GENERAL_SUBTREE = *mut CERT_GENERAL_SUBTREE; |
| 2111 |
STRUCT!{struct CERT_NAME_CONSTRAINTS_INFO { |
| 2112 |
cPermittedSubtree: DWORD, |
| 2113 |
rgPermittedSubtree: PCERT_GENERAL_SUBTREE, |
| 2114 |
cExcludedSubtree: DWORD, |
| 2115 |
rgExcludedSubtree: PCERT_GENERAL_SUBTREE, |
| 2116 |
}} |
| 2117 |
pub type PCERT_NAME_CONSTRAINTS_INFO = *mut CERT_NAME_CONSTRAINTS_INFO; |
| 2118 |
pub const CERT_EXCLUDED_SUBTREE_BIT: DWORD = 0x80000000; |
| 2119 |
#[inline] |
| 2120 |
pub fn IS_CERT_EXCLUDED_SUBTREE(X: DWORD) -> bool { |
| 2121 |
0 != (X & CERT_EXCLUDED_SUBTREE_BIT) |
| 2122 |
} |
| 2123 |
pub const SORTED_CTL_EXT_FLAGS_OFFSET: c_int = 0 * 4; |
| 2124 |
pub const SORTED_CTL_EXT_COUNT_OFFSET: c_int = 1 * 4; |
| 2125 |
pub const SORTED_CTL_EXT_MAX_COLLISION_OFFSET: c_int = 2 * 4; |
| 2126 |
pub const SORTED_CTL_EXT_HASH_BUCKET_OFFSET: c_int = 3 * 4; |
| 2127 |
pub const SORTED_CTL_EXT_HASHED_SUBJECT_IDENTIFIER_FLAG: DWORD = 0x1; |
| 2128 |
STRUCT!{struct CERT_DSS_PARAMETERS { |
| 2129 |
p: CRYPT_UINT_BLOB, |
| 2130 |
q: CRYPT_UINT_BLOB, |
| 2131 |
g: CRYPT_UINT_BLOB, |
| 2132 |
}} |
| 2133 |
pub type PCERT_DSS_PARAMETERS = *mut CERT_DSS_PARAMETERS; |
| 2134 |
pub const CERT_DSS_R_LEN: usize = 20; |
| 2135 |
pub const CERT_DSS_S_LEN: usize = 20; |
| 2136 |
pub const CERT_DSS_SIGNATURE_LEN: usize = CERT_DSS_R_LEN + CERT_DSS_S_LEN; |
| 2137 |
pub const CERT_MAX_ASN_ENCODED_DSS_SIGNATURE_LEN: usize = 2 + 2 * (2 + 20 + 1); |
| 2138 |
STRUCT!{struct CERT_DH_PARAMETERS { |
| 2139 |
p: CRYPT_UINT_BLOB, |
| 2140 |
g: CRYPT_UINT_BLOB, |
| 2141 |
}} |
| 2142 |
pub type PCERT_DH_PARAMETERS = *mut CERT_DH_PARAMETERS; |
| 2143 |
STRUCT!{struct CERT_ECC_SIGNATURE { |
| 2144 |
r: CRYPT_UINT_BLOB, |
| 2145 |
s: CRYPT_UINT_BLOB, |
| 2146 |
}} |
| 2147 |
pub type PCERT_ECC_SIGNATURE = *mut CERT_ECC_SIGNATURE; |
| 2148 |
STRUCT!{struct CERT_X942_DH_VALIDATION_PARAMS { |
| 2149 |
seed: CRYPT_BIT_BLOB, |
| 2150 |
pgenCounter: DWORD, |
| 2151 |
}} |
| 2152 |
pub type PCERT_X942_DH_VALIDATION_PARAMS = *mut CERT_X942_DH_VALIDATION_PARAMS; |
| 2153 |
STRUCT!{struct CERT_X942_DH_PARAMETERS { |
| 2154 |
p: CRYPT_UINT_BLOB, |
| 2155 |
g: CRYPT_UINT_BLOB, |
| 2156 |
q: CRYPT_UINT_BLOB, |
| 2157 |
j: CRYPT_UINT_BLOB, |
| 2158 |
pValidationParams: PCERT_X942_DH_VALIDATION_PARAMS, |
| 2159 |
}} |
| 2160 |
pub type PCERT_X942_DH_PARAMETERS = *mut CERT_X942_DH_PARAMETERS; |
| 2161 |
pub const CRYPT_X942_COUNTER_BYTE_LENGTH: usize = 4; |
| 2162 |
pub const CRYPT_X942_KEY_LENGTH_BYTE_LENGTH: usize = 4; |
| 2163 |
pub const CRYPT_X942_PUB_INFO_BYTE_LENGTH: usize = 512 / 8; |
| 2164 |
STRUCT!{struct CRYPT_X942_OTHER_INFO { |
| 2165 |
pszContentEncryptionObjId: LPSTR, |
| 2166 |
rgbCounter: [BYTE; CRYPT_X942_COUNTER_BYTE_LENGTH], |
| 2167 |
rgbKeyLength: [BYTE; CRYPT_X942_KEY_LENGTH_BYTE_LENGTH], |
| 2168 |
PubInfo: CRYPT_DATA_BLOB, |
| 2169 |
}} |
| 2170 |
pub type PCRYPT_X942_OTHER_INFO = *mut CRYPT_X942_OTHER_INFO; |
| 2171 |
pub const CRYPT_ECC_CMS_SHARED_INFO_SUPPPUBINFO_BYTE_LENGTH: usize = 4; |
| 2172 |
STRUCT!{struct CRYPT_ECC_CMS_SHARED_INFO { |
| 2173 |
Algorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2174 |
EntityUInfo: CRYPT_DATA_BLOB, |
| 2175 |
rgbSuppPubInfo: [BYTE; CRYPT_ECC_CMS_SHARED_INFO_SUPPPUBINFO_BYTE_LENGTH], |
| 2176 |
}} |
| 2177 |
pub type PCRYPT_ECC_CMS_SHARED_INFO = *mut CRYPT_ECC_CMS_SHARED_INFO; |
| 2178 |
STRUCT!{struct CRYPT_RC2_CBC_PARAMETERS { |
| 2179 |
dwVersion: DWORD, |
| 2180 |
fIV: BOOL, |
| 2181 |
rgbIV: [BYTE; 8], |
| 2182 |
}} |
| 2183 |
pub type PCRYPT_RC2_CBC_PARAMETERS = *mut CRYPT_RC2_CBC_PARAMETERS; |
| 2184 |
pub const CRYPT_RC2_40BIT_VERSION: DWORD = 160; |
| 2185 |
pub const CRYPT_RC2_56BIT_VERSION: DWORD = 52; |
| 2186 |
pub const CRYPT_RC2_64BIT_VERSION: DWORD = 120; |
| 2187 |
pub const CRYPT_RC2_128BIT_VERSION: DWORD = 58; |
| 2188 |
STRUCT!{struct CRYPT_SMIME_CAPABILITY { |
| 2189 |
pszObjId: LPSTR, |
| 2190 |
Parameters: CRYPT_OBJID_BLOB, |
| 2191 |
}} |
| 2192 |
pub type PCRYPT_SMIME_CAPABILITY = *mut CRYPT_SMIME_CAPABILITY; |
| 2193 |
STRUCT!{struct CRYPT_SMIME_CAPABILITIES { |
| 2194 |
cCapability: DWORD, |
| 2195 |
rgCapability: PCRYPT_SMIME_CAPABILITY, |
| 2196 |
}} |
| 2197 |
pub type PCRYPT_SMIME_CAPABILITIES = *mut CRYPT_SMIME_CAPABILITIES; |
| 2198 |
STRUCT!{struct CERT_QC_STATEMENT { |
| 2199 |
pszStatementId: LPSTR, |
| 2200 |
StatementInfo: CRYPT_OBJID_BLOB, |
| 2201 |
}} |
| 2202 |
pub type PCERT_QC_STATEMENT = *mut CERT_QC_STATEMENT; |
| 2203 |
STRUCT!{struct CERT_QC_STATEMENTS_EXT_INFO { |
| 2204 |
cStatement: DWORD, |
| 2205 |
rgStatement: PCERT_QC_STATEMENT, |
| 2206 |
}} |
| 2207 |
pub type PCERT_QC_STATEMENTS_EXT_INFO = *mut CERT_QC_STATEMENTS_EXT_INFO; |
| 2208 |
pub const szOID_QC_EU_COMPLIANCE: &'static str = "0.4.0.1862.1.1"; |
| 2209 |
pub const szOID_QC_SSCD: &'static str = "0.4.0.1862.1.4"; |
| 2210 |
STRUCT!{struct CRYPT_MASK_GEN_ALGORITHM { |
| 2211 |
pszObjId: LPSTR, |
| 2212 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2213 |
}} |
| 2214 |
pub type PCRYPT_MASK_GEN_ALGORITHM = *mut CRYPT_MASK_GEN_ALGORITHM; |
| 2215 |
STRUCT!{struct CRYPT_RSA_SSA_PSS_PARAMETERS { |
| 2216 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2217 |
MaskGenAlgorithm: CRYPT_MASK_GEN_ALGORITHM, |
| 2218 |
dwSaltLength: DWORD, |
| 2219 |
dwTrailerField: DWORD, |
| 2220 |
}} |
| 2221 |
pub type PCRYPT_RSA_SSA_PSS_PARAMETERS = *mut CRYPT_RSA_SSA_PSS_PARAMETERS; |
| 2222 |
pub const PKCS_RSA_SSA_PSS_TRAILER_FIELD_BC: DWORD = 1; |
| 2223 |
STRUCT!{struct CRYPT_PSOURCE_ALGORITHM { |
| 2224 |
pszObjId: LPSTR, |
| 2225 |
EncodingParameters: CRYPT_DATA_BLOB, |
| 2226 |
}} |
| 2227 |
pub type PCRYPT_PSOURCE_ALGORITHM = *mut CRYPT_PSOURCE_ALGORITHM; |
| 2228 |
STRUCT!{struct CRYPT_RSAES_OAEP_PARAMETERS { |
| 2229 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2230 |
MaskGenAlgorithm: CRYPT_MASK_GEN_ALGORITHM, |
| 2231 |
PSourceAlgorithm: CRYPT_PSOURCE_ALGORITHM, |
| 2232 |
}} |
| 2233 |
pub type PCRYPT_RSAES_OAEP_PARAMETERS = *mut CRYPT_RSAES_OAEP_PARAMETERS; |
| 2234 |
pub const szOID_VERISIGN_PRIVATE_6_9: &'static str = "2.16.840.1.113733.1.6.9"; |
| 2235 |
pub const szOID_VERISIGN_ONSITE_JURISDICTION_HASH: &'static str = "2.16.840.1.113733.1.6.11"; |
| 2236 |
pub const szOID_VERISIGN_BITSTRING_6_13: &'static str = "2.16.840.1.113733.1.6.13"; |
| 2237 |
pub const szOID_VERISIGN_ISS_STRONG_CRYPTO: &'static str = "2.16.840.1.113733.1.8.1"; |
| 2238 |
pub const szOIDVerisign_MessageType: &'static str = "2.16.840.1.113733.1.9.2"; |
| 2239 |
pub const szOIDVerisign_PkiStatus: &'static str = "2.16.840.1.113733.1.9.3"; |
| 2240 |
pub const szOIDVerisign_FailInfo: &'static str = "2.16.840.1.113733.1.9.4"; |
| 2241 |
pub const szOIDVerisign_SenderNonce: &'static str = "2.16.840.1.113733.1.9.5"; |
| 2242 |
pub const szOIDVerisign_RecipientNonce: &'static str = "2.16.840.1.113733.1.9.6"; |
| 2243 |
pub const szOIDVerisign_TransactionID: &'static str = "2.16.840.1.113733.1.9.7"; |
| 2244 |
pub const szOID_NETSCAPE: &'static str = "2.16.840.1.113730"; |
| 2245 |
pub const szOID_NETSCAPE_CERT_EXTENSION: &'static str = "2.16.840.1.113730.1"; |
| 2246 |
pub const szOID_NETSCAPE_CERT_TYPE: &'static str = "2.16.840.1.113730.1.1"; |
| 2247 |
pub const szOID_NETSCAPE_BASE_URL: &'static str = "2.16.840.1.113730.1.2"; |
| 2248 |
pub const szOID_NETSCAPE_REVOCATION_URL: &'static str = "2.16.840.1.113730.1.3"; |
| 2249 |
pub const szOID_NETSCAPE_CA_REVOCATION_URL: &'static str = "2.16.840.1.113730.1.4"; |
| 2250 |
pub const szOID_NETSCAPE_CERT_RENEWAL_URL: &'static str = "2.16.840.1.113730.1.7"; |
| 2251 |
pub const szOID_NETSCAPE_CA_POLICY_URL: &'static str = "2.16.840.1.113730.1.8"; |
| 2252 |
pub const szOID_NETSCAPE_SSL_SERVER_NAME: &'static str = "2.16.840.1.113730.1.12"; |
| 2253 |
pub const szOID_NETSCAPE_COMMENT: &'static str = "2.16.840.1.113730.1.13"; |
| 2254 |
pub const szOID_NETSCAPE_DATA_TYPE: &'static str = "2.16.840.1.113730.2"; |
| 2255 |
pub const szOID_NETSCAPE_CERT_SEQUENCE: &'static str = "2.16.840.1.113730.2.5"; |
| 2256 |
pub const NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE: DWORD = 0x80; |
| 2257 |
pub const NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE: DWORD = 0x40; |
| 2258 |
pub const NETSCAPE_SMIME_CERT_TYPE: DWORD = 0x20; |
| 2259 |
pub const NETSCAPE_SIGN_CERT_TYPE: DWORD = 0x10; |
| 2260 |
pub const NETSCAPE_SSL_CA_CERT_TYPE: DWORD = 0x04; |
| 2261 |
pub const NETSCAPE_SMIME_CA_CERT_TYPE: DWORD = 0x02; |
| 2262 |
pub const NETSCAPE_SIGN_CA_CERT_TYPE: DWORD = 0x01; |
| 2263 |
pub const szOID_CT_PKI_DATA: &'static str = "1.3.6.1.5.5.7.12.2"; |
| 2264 |
pub const szOID_CT_PKI_RESPONSE: &'static str = "1.3.6.1.5.5.7.12.3"; |
| 2265 |
pub const szOID_PKIX_NO_SIGNATURE: &'static str = "1.3.6.1.5.5.7.6.2"; |
| 2266 |
pub const szOID_CMC: &'static str = "1.3.6.1.5.5.7.7"; |
| 2267 |
pub const szOID_CMC_STATUS_INFO: &'static str = "1.3.6.1.5.5.7.7.1"; |
| 2268 |
pub const szOID_CMC_IDENTIFICATION: &'static str = "1.3.6.1.5.5.7.7.2"; |
| 2269 |
pub const szOID_CMC_IDENTITY_PROOF: &'static str = "1.3.6.1.5.5.7.7.3"; |
| 2270 |
pub const szOID_CMC_DATA_RETURN: &'static str = "1.3.6.1.5.5.7.7.4"; |
| 2271 |
pub const szOID_CMC_TRANSACTION_ID: &'static str = "1.3.6.1.5.5.7.7.5"; |
| 2272 |
pub const szOID_CMC_SENDER_NONCE: &'static str = "1.3.6.1.5.5.7.7.6"; |
| 2273 |
pub const szOID_CMC_RECIPIENT_NONCE: &'static str = "1.3.6.1.5.5.7.7.7"; |
| 2274 |
pub const szOID_CMC_ADD_EXTENSIONS: &'static str = "1.3.6.1.5.5.7.7.8"; |
| 2275 |
pub const szOID_CMC_ENCRYPTED_POP: &'static str = "1.3.6.1.5.5.7.7.9"; |
| 2276 |
pub const szOID_CMC_DECRYPTED_POP: &'static str = "1.3.6.1.5.5.7.7.10"; |
| 2277 |
pub const szOID_CMC_LRA_POP_WITNESS: &'static str = "1.3.6.1.5.5.7.7.11"; |
| 2278 |
pub const szOID_CMC_GET_CERT: &'static str = "1.3.6.1.5.5.7.7.15"; |
| 2279 |
pub const szOID_CMC_GET_CRL: &'static str = "1.3.6.1.5.5.7.7.16"; |
| 2280 |
pub const szOID_CMC_REVOKE_REQUEST: &'static str = "1.3.6.1.5.5.7.7.17"; |
| 2281 |
pub const szOID_CMC_REG_INFO: &'static str = "1.3.6.1.5.5.7.7.18"; |
| 2282 |
pub const szOID_CMC_RESPONSE_INFO: &'static str = "1.3.6.1.5.5.7.7.19"; |
| 2283 |
pub const szOID_CMC_QUERY_PENDING: &'static str = "1.3.6.1.5.5.7.7.21"; |
| 2284 |
pub const szOID_CMC_ID_POP_LINK_RANDOM: &'static str = "1.3.6.1.5.5.7.7.22"; |
| 2285 |
pub const szOID_CMC_ID_POP_LINK_WITNESS: &'static str = "1.3.6.1.5.5.7.7.23"; |
| 2286 |
pub const szOID_CMC_ID_CONFIRM_CERT_ACCEPTANCE: &'static str = "1.3.6.1.5.5.7.7.24"; |
| 2287 |
pub const szOID_CMC_ADD_ATTRIBUTES: &'static str = "1.3.6.1.4.1.311.10.10.1"; |
| 2288 |
STRUCT!{struct CMC_TAGGED_ATTRIBUTE { |
| 2289 |
dwBodyPartID: DWORD, |
| 2290 |
Attribute: CRYPT_ATTRIBUTE, |
| 2291 |
}} |
| 2292 |
pub type PCMC_TAGGED_ATTRIBUTE = *mut CMC_TAGGED_ATTRIBUTE; |
| 2293 |
STRUCT!{struct CMC_TAGGED_CERT_REQUEST { |
| 2294 |
dwBodyPartID: DWORD, |
| 2295 |
SignedCertRequest: CRYPT_DER_BLOB, |
| 2296 |
}} |
| 2297 |
pub type PCMC_TAGGED_CERT_REQUEST = *mut CMC_TAGGED_CERT_REQUEST; |
| 2298 |
UNION!{union CMC_TAGGED_REQUEST_u { |
| 2299 |
[usize; 1], |
| 2300 |
pTaggedCertRequest pTaggedCertRequest_mut: PCMC_TAGGED_CERT_REQUEST, |
| 2301 |
}} |
| 2302 |
STRUCT!{struct CMC_TAGGED_REQUEST { |
| 2303 |
dwTaggedRequestChoice: DWORD, |
| 2304 |
u: CMC_TAGGED_REQUEST_u, |
| 2305 |
}} |
| 2306 |
pub type PCMC_TAGGED_REQUEST = *mut CMC_TAGGED_REQUEST; |
| 2307 |
STRUCT!{struct CMC_TAGGED_CONTENT_INFO { |
| 2308 |
dwBodyPartID: DWORD, |
| 2309 |
EncodedContentInfo: CRYPT_DER_BLOB, |
| 2310 |
}} |
| 2311 |
pub type PCMC_TAGGED_CONTENT_INFO = *mut CMC_TAGGED_CONTENT_INFO; |
| 2312 |
STRUCT!{struct CMC_TAGGED_OTHER_MSG { |
| 2313 |
dwBodyPartID: DWORD, |
| 2314 |
pszObjId: LPSTR, |
| 2315 |
Value: CRYPT_OBJID_BLOB, |
| 2316 |
}} |
| 2317 |
pub type PCMC_TAGGED_OTHER_MSG = *mut CMC_TAGGED_OTHER_MSG; |
| 2318 |
STRUCT!{struct CMC_DATA_INFO { |
| 2319 |
cTaggedAttribute: DWORD, |
| 2320 |
rgTaggedAttribute: PCMC_TAGGED_ATTRIBUTE, |
| 2321 |
cTaggedRequest: DWORD, |
| 2322 |
rgTaggedRequest: PCMC_TAGGED_REQUEST, |
| 2323 |
cTaggedContentInfo: DWORD, |
| 2324 |
rgTaggedContentInfo: PCMC_TAGGED_CONTENT_INFO, |
| 2325 |
cTaggedOtherMsg: DWORD, |
| 2326 |
rgTaggedOtherMsg: PCMC_TAGGED_OTHER_MSG, |
| 2327 |
}} |
| 2328 |
pub type PCMC_DATA_INFO = *mut CMC_DATA_INFO; |
| 2329 |
STRUCT!{struct CMC_RESPONSE_INFO { |
| 2330 |
cTaggedAttribute: DWORD, |
| 2331 |
rgTaggedAttribute: PCMC_TAGGED_ATTRIBUTE, |
| 2332 |
cTaggedContentInfo: DWORD, |
| 2333 |
rgTaggedContentInfo: PCMC_TAGGED_CONTENT_INFO, |
| 2334 |
cTaggedOtherMsg: DWORD, |
| 2335 |
rgTaggedOtherMsg: PCMC_TAGGED_OTHER_MSG, |
| 2336 |
}} |
| 2337 |
pub type PCMC_RESPONSE_INFO = *mut CMC_RESPONSE_INFO; |
| 2338 |
STRUCT!{struct CMC_PEND_INFO { |
| 2339 |
PendToken: CRYPT_DATA_BLOB, |
| 2340 |
PendTime: FILETIME, |
| 2341 |
}} |
| 2342 |
pub type PCMC_PEND_INFO = *mut CMC_PEND_INFO; |
| 2343 |
UNION!{union CMC_STATUS_INFO_u { |
| 2344 |
[usize; 1], |
| 2345 |
dwFailInfo dwFailInfo_mut: DWORD, |
| 2346 |
pPendInfo pPendInfo_mut: PCMC_PEND_INFO, |
| 2347 |
}} |
| 2348 |
STRUCT!{struct CMC_STATUS_INFO { |
| 2349 |
dwStatus: DWORD, |
| 2350 |
cBodyList: DWORD, |
| 2351 |
rgdwBodyList: *mut DWORD, |
| 2352 |
pwszStatusString: LPWSTR, |
| 2353 |
dwOtherInfoChoice: DWORD, |
| 2354 |
u: CMC_STATUS_INFO_u, |
| 2355 |
}} |
| 2356 |
pub type PCMC_STATUS_INFO = *mut CMC_STATUS_INFO; |
| 2357 |
pub const CMC_OTHER_INFO_NO_CHOICE: DWORD = 0; |
| 2358 |
pub const CMC_OTHER_INFO_FAIL_CHOICE: DWORD = 1; |
| 2359 |
pub const CMC_OTHER_INFO_PEND_CHOICE: DWORD = 2; |
| 2360 |
pub const CMC_STATUS_SUCCESS: DWORD = 0; |
| 2361 |
pub const CMC_STATUS_FAILED: DWORD = 2; |
| 2362 |
pub const CMC_STATUS_PENDING: DWORD = 3; |
| 2363 |
pub const CMC_STATUS_NO_SUPPORT: DWORD = 4; |
| 2364 |
pub const CMC_STATUS_CONFIRM_REQUIRED: DWORD = 5; |
| 2365 |
pub const CMC_FAIL_BAD_ALG: DWORD = 0; |
| 2366 |
pub const CMC_FAIL_BAD_MESSAGE_CHECK: DWORD = 1; |
| 2367 |
pub const CMC_FAIL_BAD_REQUEST: DWORD = 2; |
| 2368 |
pub const CMC_FAIL_BAD_TIME: DWORD = 3; |
| 2369 |
pub const CMC_FAIL_BAD_CERT_ID: DWORD = 4; |
| 2370 |
pub const CMC_FAIL_UNSUPORTED_EXT: DWORD = 5; |
| 2371 |
pub const CMC_FAIL_MUST_ARCHIVE_KEYS: DWORD = 6; |
| 2372 |
pub const CMC_FAIL_BAD_IDENTITY: DWORD = 7; |
| 2373 |
pub const CMC_FAIL_POP_REQUIRED: DWORD = 8; |
| 2374 |
pub const CMC_FAIL_POP_FAILED: DWORD = 9; |
| 2375 |
pub const CMC_FAIL_NO_KEY_REUSE: DWORD = 10; |
| 2376 |
pub const CMC_FAIL_INTERNAL_CA_ERROR: DWORD = 11; |
| 2377 |
pub const CMC_FAIL_TRY_LATER: DWORD = 12; |
| 2378 |
STRUCT!{struct CMC_ADD_EXTENSIONS_INFO { |
| 2379 |
dwCmcDataReference: DWORD, |
| 2380 |
cCertReference: DWORD, |
| 2381 |
rgdwCertReference: *mut DWORD, |
| 2382 |
cExtension: DWORD, |
| 2383 |
rgExtension: PCERT_EXTENSION, |
| 2384 |
}} |
| 2385 |
pub type PCMC_ADD_EXTENSIONS_INFO = *mut CMC_ADD_EXTENSIONS_INFO; |
| 2386 |
STRUCT!{struct CMC_ADD_ATTRIBUTES_INFO { |
| 2387 |
dwCmcDataReference: DWORD, |
| 2388 |
cCertReference: DWORD, |
| 2389 |
rgdwCertReference: *mut DWORD, |
| 2390 |
cAttribute: DWORD, |
| 2391 |
rgAttribute: PCRYPT_ATTRIBUTE, |
| 2392 |
}} |
| 2393 |
pub type PCMC_ADD_ATTRIBUTES_INFO = *mut CMC_ADD_ATTRIBUTES_INFO; |
| 2394 |
STRUCT!{struct CERT_TEMPLATE_EXT { |
| 2395 |
pszObjId: LPSTR, |
| 2396 |
dwMajorVersion: DWORD, |
| 2397 |
fMinorVersion: BOOL, |
| 2398 |
dwMinorVersion: DWORD, |
| 2399 |
}} |
| 2400 |
pub type PCERT_TEMPLATE_EXT = *mut CERT_TEMPLATE_EXT; |
| 2401 |
STRUCT!{struct CERT_HASHED_URL { |
| 2402 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2403 |
Hash: CRYPT_HASH_BLOB, |
| 2404 |
pwszUrl: LPWSTR, |
| 2405 |
}} |
| 2406 |
pub type PCERT_HASHED_URL = *mut CERT_HASHED_URL; |
| 2407 |
STRUCT!{struct CERT_LOGOTYPE_DETAILS { |
| 2408 |
pwszMimeType: LPWSTR, |
| 2409 |
cHashedUrl: DWORD, |
| 2410 |
rgHashedUrl: PCERT_HASHED_URL, |
| 2411 |
}} |
| 2412 |
pub type PCERT_LOGOTYPE_DETAILS = *mut CERT_LOGOTYPE_DETAILS; |
| 2413 |
STRUCT!{struct CERT_LOGOTYPE_REFERENCE { |
| 2414 |
cHashedUrl: DWORD, |
| 2415 |
rgHashedUrl: PCERT_HASHED_URL, |
| 2416 |
}} |
| 2417 |
pub type PCERT_LOGOTYPE_REFERENCE = *mut CERT_LOGOTYPE_REFERENCE; |
| 2418 |
UNION!{union CERT_LOGOTYPE_IMAGE_INFO_u { |
| 2419 |
[u32; 1], |
| 2420 |
dwNumBits dwNumBits_mut: DWORD, |
| 2421 |
dwTableSize dwTableSize_mut: DWORD, |
| 2422 |
}} |
| 2423 |
STRUCT!{struct CERT_LOGOTYPE_IMAGE_INFO { |
| 2424 |
dwLogotypeImageInfoChoice: DWORD, |
| 2425 |
dwFileSize: DWORD, |
| 2426 |
dwXSize: DWORD, |
| 2427 |
dwYSize: DWORD, |
| 2428 |
dwLogotypeImageResolutionChoice: DWORD, |
| 2429 |
u: CERT_LOGOTYPE_IMAGE_INFO_u, |
| 2430 |
pwszLanguage: LPWSTR, |
| 2431 |
}} |
| 2432 |
pub type PCERT_LOGOTYPE_IMAGE_INFO = *mut CERT_LOGOTYPE_IMAGE_INFO; |
| 2433 |
pub const CERT_LOGOTYPE_GRAY_SCALE_IMAGE_INFO_CHOICE: DWORD = 1; |
| 2434 |
pub const CERT_LOGOTYPE_COLOR_IMAGE_INFO_CHOICE: DWORD = 2; |
| 2435 |
pub const CERT_LOGOTYPE_NO_IMAGE_RESOLUTION_CHOICE: DWORD = 0; |
| 2436 |
pub const CERT_LOGOTYPE_BITS_IMAGE_RESOLUTION_CHOICE: DWORD = 1; |
| 2437 |
pub const CERT_LOGOTYPE_TABLE_SIZE_IMAGE_RESOLUTION_CHOICE: DWORD = 2; |
| 2438 |
STRUCT!{struct CERT_LOGOTYPE_IMAGE { |
| 2439 |
LogotypeDetails: CERT_LOGOTYPE_DETAILS, |
| 2440 |
pLogotypeImageInfo: PCERT_LOGOTYPE_IMAGE_INFO, |
| 2441 |
}} |
| 2442 |
pub type PCERT_LOGOTYPE_IMAGE = *mut CERT_LOGOTYPE_IMAGE; |
| 2443 |
STRUCT!{struct CERT_LOGOTYPE_AUDIO_INFO { |
| 2444 |
dwFileSize: DWORD, |
| 2445 |
dwPlayTime: DWORD, |
| 2446 |
dwChannels: DWORD, |
| 2447 |
dwSampleRate: DWORD, |
| 2448 |
pwszLanguage: LPWSTR, |
| 2449 |
}} |
| 2450 |
pub type PCERT_LOGOTYPE_AUDIO_INFO = *mut CERT_LOGOTYPE_AUDIO_INFO; |
| 2451 |
STRUCT!{struct CERT_LOGOTYPE_AUDIO { |
| 2452 |
LogotypeDetails: CERT_LOGOTYPE_DETAILS, |
| 2453 |
pLogotypeAudioInfo: PCERT_LOGOTYPE_AUDIO_INFO, |
| 2454 |
}} |
| 2455 |
pub type PCERT_LOGOTYPE_AUDIO = *mut CERT_LOGOTYPE_AUDIO; |
| 2456 |
STRUCT!{struct CERT_LOGOTYPE_DATA { |
| 2457 |
cLogotypeImage: DWORD, |
| 2458 |
rgLogotypeImage: PCERT_LOGOTYPE_IMAGE, |
| 2459 |
cLogotypeAudio: DWORD, |
| 2460 |
rgLogotypeAudio: PCERT_LOGOTYPE_AUDIO, |
| 2461 |
}} |
| 2462 |
pub type PCERT_LOGOTYPE_DATA = *mut CERT_LOGOTYPE_DATA; |
| 2463 |
UNION!{union CERT_LOGOTYPE_INFO_u { |
| 2464 |
[usize; 1], |
| 2465 |
pLogotypeDirectInfo pLogotypeDirectInfo_mut: PCERT_LOGOTYPE_DATA, |
| 2466 |
pLogotypeIndirectInfo pLogotypeIndirectInfo__mut: PCERT_LOGOTYPE_REFERENCE, |
| 2467 |
}} |
| 2468 |
STRUCT!{struct CERT_LOGOTYPE_INFO { |
| 2469 |
dwLogotypeInfoChoice: DWORD, |
| 2470 |
u: CERT_LOGOTYPE_INFO_u, |
| 2471 |
}} |
| 2472 |
pub type PCERT_LOGOTYPE_INFO = *mut CERT_LOGOTYPE_INFO; |
| 2473 |
pub const CERT_LOGOTYPE_DIRECT_INFO_CHOICE: DWORD = 1; |
| 2474 |
pub const CERT_LOGOTYPE_INDIRECT_INFO_CHOICE: DWORD = 2; |
| 2475 |
STRUCT!{struct CERT_OTHER_LOGOTYPE_INFO { |
| 2476 |
pszObjId: LPSTR, |
| 2477 |
LogotypeInfo: CERT_LOGOTYPE_INFO, |
| 2478 |
}} |
| 2479 |
pub type PCERT_OTHER_LOGOTYPE_INFO = *mut CERT_OTHER_LOGOTYPE_INFO; |
| 2480 |
pub const szOID_LOYALTY_OTHER_LOGOTYPE: &'static str = "1.3.6.1.5.5.7.20.1"; |
| 2481 |
pub const szOID_BACKGROUND_OTHER_LOGOTYPE: &'static str = "1.3.6.1.5.5.7.20.2"; |
| 2482 |
STRUCT!{struct CERT_LOGOTYPE_EXT_INFO { |
| 2483 |
cCommunityLogo: DWORD, |
| 2484 |
rgCommunityLogo: PCERT_LOGOTYPE_INFO, |
| 2485 |
pIssuerLogo: PCERT_LOGOTYPE_INFO, |
| 2486 |
pSubjectLogo: PCERT_LOGOTYPE_INFO, |
| 2487 |
cOtherLogo: DWORD, |
| 2488 |
rgOtherLogo: PCERT_OTHER_LOGOTYPE_INFO, |
| 2489 |
}} |
| 2490 |
pub type PCERT_LOGOTYPE_EXT_INFO = *mut CERT_LOGOTYPE_EXT_INFO; |
| 2491 |
UNION!{union CERT_BIOMETRIC_DATA_u { |
| 2492 |
[usize; 1], |
| 2493 |
dwPredefined dwPredefined_mut: DWORD, |
| 2494 |
pszObjId pszObjId_mut: LPSTR, |
| 2495 |
}} |
| 2496 |
STRUCT!{struct CERT_BIOMETRIC_DATA { |
| 2497 |
dwTypeOfBiometricDataChoice: DWORD, |
| 2498 |
u: CERT_BIOMETRIC_DATA_u, |
| 2499 |
HashedUrl: CERT_HASHED_URL, |
| 2500 |
}} |
| 2501 |
pub type PCERT_BIOMETRIC_DATA = *mut CERT_BIOMETRIC_DATA; |
| 2502 |
pub const CERT_BIOMETRIC_PREDEFINED_DATA_CHOICE: DWORD = 1; |
| 2503 |
pub const CERT_BIOMETRIC_OID_DATA_CHOICE: DWORD = 2; |
| 2504 |
pub const CERT_BIOMETRIC_PICTURE_TYPE: DWORD = 0; |
| 2505 |
pub const CERT_BIOMETRIC_SIGNATURE_TYPE: DWORD = 1; |
| 2506 |
STRUCT!{struct CERT_BIOMETRIC_EXT_INFO { |
| 2507 |
cBiometricData: DWORD, |
| 2508 |
rgBiometricData: PCERT_BIOMETRIC_DATA, |
| 2509 |
}} |
| 2510 |
pub type PCERT_BIOMETRIC_EXT_INFO = *mut CERT_BIOMETRIC_EXT_INFO; |
| 2511 |
STRUCT!{struct OCSP_SIGNATURE_INFO { |
| 2512 |
SignatureAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2513 |
Signature: CRYPT_BIT_BLOB, |
| 2514 |
cCertEncoded: DWORD, |
| 2515 |
rgCertEncoded: PCERT_BLOB, |
| 2516 |
}} |
| 2517 |
pub type POCSP_SIGNATURE_INFO = *mut OCSP_SIGNATURE_INFO; |
| 2518 |
STRUCT!{struct OCSP_SIGNED_REQUEST_INFO { |
| 2519 |
ToBeSigned: CRYPT_DER_BLOB, |
| 2520 |
pOptionalSignatureInfo: POCSP_SIGNATURE_INFO, |
| 2521 |
}} |
| 2522 |
pub type POCSP_SIGNED_REQUEST_INFO = *mut OCSP_SIGNED_REQUEST_INFO; |
| 2523 |
STRUCT!{struct OCSP_CERT_ID { |
| 2524 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2525 |
IssuerNameHash: CRYPT_HASH_BLOB, |
| 2526 |
IssuerKeyHash: CRYPT_HASH_BLOB, |
| 2527 |
SerialNumber: CRYPT_INTEGER_BLOB, |
| 2528 |
}} |
| 2529 |
pub type POCSP_CERT_ID = *mut OCSP_CERT_ID; |
| 2530 |
STRUCT!{struct OCSP_REQUEST_ENTRY { |
| 2531 |
CertId: OCSP_CERT_ID, |
| 2532 |
cExtension: DWORD, |
| 2533 |
rgExtension: PCERT_EXTENSION, |
| 2534 |
}} |
| 2535 |
pub type POCSP_REQUEST_ENTRY = *mut OCSP_REQUEST_ENTRY; |
| 2536 |
STRUCT!{struct OCSP_REQUEST_INFO { |
| 2537 |
dwVersion: DWORD, |
| 2538 |
pRequestorName: PCERT_ALT_NAME_ENTRY, |
| 2539 |
cRequestEntry: DWORD, |
| 2540 |
rgRequestEntry: POCSP_REQUEST_ENTRY, |
| 2541 |
cExtension: DWORD, |
| 2542 |
rgExtension: PCERT_EXTENSION, |
| 2543 |
}} |
| 2544 |
pub type POCSP_REQUEST_INFO = *mut OCSP_REQUEST_INFO; |
| 2545 |
pub const OCSP_REQUEST_V1: DWORD = 0; |
| 2546 |
STRUCT!{struct OCSP_RESPONSE_INFO { |
| 2547 |
dwStatus: DWORD, |
| 2548 |
pszObjId: LPSTR, |
| 2549 |
Value: CRYPT_OBJID_BLOB, |
| 2550 |
}} |
| 2551 |
pub type POCSP_RESPONSE_INFO = *mut OCSP_RESPONSE_INFO; |
| 2552 |
pub const OCSP_SUCCESSFUL_RESPONSE: DWORD = 0; |
| 2553 |
pub const OCSP_MALFORMED_REQUEST_RESPONSE: DWORD = 1; |
| 2554 |
pub const OCSP_INTERNAL_ERROR_RESPONSE: DWORD = 2; |
| 2555 |
pub const OCSP_TRY_LATER_RESPONSE: DWORD = 3; |
| 2556 |
pub const OCSP_SIG_REQUIRED_RESPONSE: DWORD = 5; |
| 2557 |
pub const OCSP_UNAUTHORIZED_RESPONSE: DWORD = 6; |
| 2558 |
pub const szOID_PKIX_OCSP_BASIC_SIGNED_RESPONSE: &'static str = "1.3.6.1.5.5.7.48.1.1"; |
| 2559 |
STRUCT!{struct OCSP_BASIC_SIGNED_RESPONSE_INFO { |
| 2560 |
ToBeSigned: CRYPT_DER_BLOB, |
| 2561 |
SignatureInfo: OCSP_SIGNATURE_INFO, |
| 2562 |
}} |
| 2563 |
pub type POCSP_BASIC_SIGNED_RESPONSE_INFO = *mut OCSP_BASIC_SIGNED_RESPONSE_INFO; |
| 2564 |
STRUCT!{struct OCSP_BASIC_REVOKED_INFO { |
| 2565 |
RevocationDate: FILETIME, |
| 2566 |
dwCrlReasonCode: DWORD, |
| 2567 |
}} |
| 2568 |
pub type POCSP_BASIC_REVOKED_INFO = *mut OCSP_BASIC_REVOKED_INFO; |
| 2569 |
UNION!{union OCSP_BASIC_RESPONSE_ENTRY_u { |
| 2570 |
[usize; 1], |
| 2571 |
pRevokedInfo pRevokedInfo_mut: POCSP_BASIC_REVOKED_INFO, |
| 2572 |
}} |
| 2573 |
STRUCT!{struct OCSP_BASIC_RESPONSE_ENTRY { |
| 2574 |
CertId: OCSP_CERT_ID, |
| 2575 |
dwCertStatus: DWORD, |
| 2576 |
u: OCSP_BASIC_RESPONSE_ENTRY_u, |
| 2577 |
ThisUpdate: FILETIME, |
| 2578 |
NextUpdate: FILETIME, |
| 2579 |
cExtension: DWORD, |
| 2580 |
rgExtension: PCERT_EXTENSION, |
| 2581 |
}} |
| 2582 |
pub type POCSP_BASIC_RESPONSE_ENTRY = *mut OCSP_BASIC_RESPONSE_ENTRY; |
| 2583 |
pub const OCSP_BASIC_GOOD_CERT_STATUS: DWORD = 0; |
| 2584 |
pub const OCSP_BASIC_REVOKED_CERT_STATUS: DWORD = 1; |
| 2585 |
pub const OCSP_BASIC_UNKNOWN_CERT_STATUS: DWORD = 2; |
| 2586 |
UNION!{union OCSP_BASIC_RESPONSE_INFO_u { |
| 2587 |
[usize; 2], |
| 2588 |
ByNameResponderId ByNameResponderId_mut: CERT_NAME_BLOB, |
| 2589 |
ByKeyResponderId ByKeyResponderId_mut: CRYPT_HASH_BLOB, |
| 2590 |
}} |
| 2591 |
STRUCT!{struct OCSP_BASIC_RESPONSE_INFO { |
| 2592 |
dwVersion: DWORD, |
| 2593 |
dwResponderIdChoice: DWORD, |
| 2594 |
u: OCSP_BASIC_RESPONSE_INFO_u, |
| 2595 |
ProducedAt: FILETIME, |
| 2596 |
cResponseEntry: DWORD, |
| 2597 |
rgResponseEntry: POCSP_BASIC_RESPONSE_ENTRY, |
| 2598 |
cExtension: DWORD, |
| 2599 |
rgExtension: PCERT_EXTENSION, |
| 2600 |
}} |
| 2601 |
pub type POCSP_BASIC_RESPONSE_INFO = *mut OCSP_BASIC_RESPONSE_INFO; |
| 2602 |
pub const OCSP_BASIC_RESPONSE_V1: DWORD = 0; |
| 2603 |
pub const OCSP_BASIC_BY_NAME_RESPONDER_ID: DWORD = 1; |
| 2604 |
pub const OCSP_BASIC_BY_KEY_RESPONDER_ID: DWORD = 2; |
| 2605 |
STRUCT!{struct CERT_SUPPORTED_ALGORITHM_INFO { |
| 2606 |
Algorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2607 |
IntendedKeyUsage: CRYPT_BIT_BLOB, |
| 2608 |
IntendedCertPolicies: CERT_POLICIES_INFO, |
| 2609 |
}} |
| 2610 |
pub type PCERT_SUPPORTED_ALGORITHM_INFO = *mut CERT_SUPPORTED_ALGORITHM_INFO; |
| 2611 |
STRUCT!{struct CERT_TPM_SPECIFICATION_INFO { |
| 2612 |
pwszFamily: LPWSTR, |
| 2613 |
dwLevel: DWORD, |
| 2614 |
dwRevision: DWORD, |
| 2615 |
}} |
| 2616 |
pub type PCERT_TPM_SPECIFICATION_INFO = *mut CERT_TPM_SPECIFICATION_INFO; |
| 2617 |
pub type HCRYPTOIDFUNCSET = *mut c_void; |
| 2618 |
pub type HCRYPTOIDFUNCADDR = *mut c_void; |
| 2619 |
pub const CRYPT_OID_ENCODE_OBJECT_FUNC: &'static str = "CryptDllEncodeObject"; |
| 2620 |
pub const CRYPT_OID_DECODE_OBJECT_FUNC: &'static str = "CryptDllDecodeObject"; |
| 2621 |
pub const CRYPT_OID_ENCODE_OBJECT_EX_FUNC: &'static str = "CryptDllEncodeObjectEx"; |
| 2622 |
pub const CRYPT_OID_DECODE_OBJECT_EX_FUNC: &'static str = "CryptDllDecodeObjectEx"; |
| 2623 |
pub const CRYPT_OID_CREATE_COM_OBJECT_FUNC: &'static str = "CryptDllCreateCOMObject"; |
| 2624 |
pub const CRYPT_OID_VERIFY_REVOCATION_FUNC: &'static str = "CertDllVerifyRevocation"; |
| 2625 |
pub const CRYPT_OID_VERIFY_CTL_USAGE_FUNC: &'static str = "CertDllVerifyCTLUsage"; |
| 2626 |
pub const CRYPT_OID_FORMAT_OBJECT_FUNC: &'static str = "CryptDllFormatObject"; |
| 2627 |
pub const CRYPT_OID_FIND_OID_INFO_FUNC: &'static str = "CryptDllFindOIDInfo"; |
| 2628 |
pub const CRYPT_OID_FIND_LOCALIZED_NAME_FUNC: &'static str = "CryptDllFindLocalizedName"; |
| 2629 |
pub const CRYPT_OID_REGPATH: &'static str = "Software\\Microsoft\\Cryptography\\OID"; |
| 2630 |
pub const CRYPT_OID_REG_ENCODING_TYPE_PREFIX: &'static str = "EncodingType "; |
| 2631 |
pub const CRYPT_OID_REG_DLL_VALUE_NAME: &'static str = "Dll"; |
| 2632 |
pub const CRYPT_OID_REG_FUNC_NAME_VALUE_NAME: &'static str = "FuncName"; |
| 2633 |
pub const CRYPT_OID_REG_FLAGS_VALUE_NAME: &'static str = "CryptFlags"; |
| 2634 |
pub const CRYPT_DEFAULT_OID: &'static str = "DEFAULT"; |
| 2635 |
STRUCT!{struct CRYPT_OID_FUNC_ENTRY { |
| 2636 |
pszOID: LPCSTR, |
| 2637 |
pvFuncAddr: *mut c_void, |
| 2638 |
}} |
| 2639 |
pub type PCRYPT_OID_FUNC_ENTRY = *mut CRYPT_OID_FUNC_ENTRY; |
| 2640 |
pub const CRYPT_INSTALL_OID_FUNC_BEFORE_FLAG: DWORD = 1; |
| 2641 |
extern "system" { |
| 2642 |
pub fn CryptInstallOIDFunctionAddress( |
| 2643 |
hModule: HMODULE, |
| 2644 |
dwEncodingType: DWORD, |
| 2645 |
pszFuncName: LPCSTR, |
| 2646 |
cFuncEntry: DWORD, |
| 2647 |
rgFuncEntry: *const CRYPT_OID_FUNC_ENTRY, |
| 2648 |
dwFlags: DWORD, |
| 2649 |
) -> BOOL; |
| 2650 |
pub fn CryptInitOIDFunctionSet( |
| 2651 |
pszFuncName: LPCSTR, |
| 2652 |
dwFlags: DWORD, |
| 2653 |
) -> HCRYPTOIDFUNCSET; |
| 2654 |
pub fn CryptGetOIDFunctionAddress( |
| 2655 |
hFuncSet: HCRYPTOIDFUNCSET, |
| 2656 |
dwEncodingType: DWORD, |
| 2657 |
pszOID: LPCSTR, |
| 2658 |
dwFlags: DWORD, |
| 2659 |
ppvFuncAddr: *mut *mut c_void, |
| 2660 |
phFuncAddr: *mut HCRYPTOIDFUNCADDR, |
| 2661 |
) -> BOOL; |
| 2662 |
} |
| 2663 |
pub const CRYPT_GET_INSTALLED_OID_FUNC_FLAG: DWORD = 0x1; |
| 2664 |
extern "system" { |
| 2665 |
pub fn CryptGetDefaultOIDDllList( |
| 2666 |
hFuncSet: HCRYPTOIDFUNCSET, |
| 2667 |
dwEncodingType: DWORD, |
| 2668 |
pwszDllList: *mut WCHAR, |
| 2669 |
pcchDllList: *mut DWORD, |
| 2670 |
) -> BOOL; |
| 2671 |
pub fn CryptGetDefaultOIDFunctionAddress( |
| 2672 |
hFuncSet: HCRYPTOIDFUNCSET, |
| 2673 |
dwEncodingType: DWORD, |
| 2674 |
pwszDll: LPCWSTR, |
| 2675 |
dwFlags: DWORD, |
| 2676 |
ppvFuncAddr: *mut *mut c_void, |
| 2677 |
phFuncAddr: *mut HCRYPTOIDFUNCADDR, |
| 2678 |
) -> BOOL; |
| 2679 |
pub fn CryptFreeOIDFunctionAddress( |
| 2680 |
hFuncAddr: HCRYPTOIDFUNCADDR, |
| 2681 |
dwFlags: DWORD, |
| 2682 |
) -> BOOL; |
| 2683 |
pub fn CryptRegisterOIDFunction( |
| 2684 |
dwEncodingType: DWORD, |
| 2685 |
pszFuncName: LPCSTR, |
| 2686 |
pszOID: LPCSTR, |
| 2687 |
pwszDll: LPCWSTR, |
| 2688 |
pszOverrideFuncName: LPCSTR, |
| 2689 |
) -> BOOL; |
| 2690 |
pub fn CryptUnregisterOIDFunction( |
| 2691 |
dwEncodingType: DWORD, |
| 2692 |
pszFuncName: LPCSTR, |
| 2693 |
pszOID: LPCSTR, |
| 2694 |
) -> BOOL; |
| 2695 |
pub fn CryptRegisterDefaultOIDFunction( |
| 2696 |
dwEncodingType: DWORD, |
| 2697 |
pszFuncName: LPCSTR, |
| 2698 |
dwIndex: DWORD, |
| 2699 |
pwszDll: LPCWSTR, |
| 2700 |
) -> BOOL; |
| 2701 |
} |
| 2702 |
pub const CRYPT_REGISTER_FIRST_INDEX: DWORD = 0; |
| 2703 |
pub const CRYPT_REGISTER_LAST_INDEX: DWORD = 0xFFFFFFFF; |
| 2704 |
extern "system" { |
| 2705 |
pub fn CryptUnregisterDefaultOIDFunction( |
| 2706 |
dwEncodingType: DWORD, |
| 2707 |
pszFuncName: LPCSTR, |
| 2708 |
pwszDll: LPCWSTR, |
| 2709 |
) -> BOOL; |
| 2710 |
pub fn CryptSetOIDFunctionValue( |
| 2711 |
dwEncodingType: DWORD, |
| 2712 |
pszFuncName: LPCSTR, |
| 2713 |
pszOID: LPCSTR, |
| 2714 |
pwszValueName: LPCWSTR, |
| 2715 |
dwValueType: DWORD, |
| 2716 |
pbValueData: *const BYTE, |
| 2717 |
cbValueData: DWORD, |
| 2718 |
) -> BOOL; |
| 2719 |
pub fn CryptGetOIDFunctionValue( |
| 2720 |
dwEncodingType: DWORD, |
| 2721 |
pszFuncName: LPCSTR, |
| 2722 |
pszOID: LPCSTR, |
| 2723 |
pwszValueName: LPCWSTR, |
| 2724 |
pdwValueType: *mut DWORD, |
| 2725 |
pbValueData: *mut BYTE, |
| 2726 |
pcbValueData: *mut DWORD, |
| 2727 |
) -> BOOL; |
| 2728 |
} |
| 2729 |
FN!{stdcall PFN_CRYPT_ENUM_OID_FUNC( |
| 2730 |
dwEncodingType: DWORD, |
| 2731 |
pszFuncName: LPCSTR, |
| 2732 |
pszOID: LPCSTR, |
| 2733 |
cValue: DWORD, |
| 2734 |
rgdwValueType: *const DWORD, |
| 2735 |
rgpwszValueName: *const LPCWSTR, |
| 2736 |
rgpbValueData: *const *const BYTE, |
| 2737 |
rgcbValueData: *const DWORD, |
| 2738 |
pvArg: *mut c_void, |
| 2739 |
) -> BOOL} |
| 2740 |
extern "system" { |
| 2741 |
pub fn CryptEnumOIDFunction( |
| 2742 |
dwEncodingType: DWORD, |
| 2743 |
pszFuncName: LPCSTR, |
| 2744 |
pszOID: LPCSTR, |
| 2745 |
dwFlags: DWORD, |
| 2746 |
pvArg: *mut c_void, |
| 2747 |
pfnEnumOIDFunc: PFN_CRYPT_ENUM_OID_FUNC, |
| 2748 |
) -> BOOL; |
| 2749 |
} |
| 2750 |
pub const CRYPT_MATCH_ANY_ENCODING_TYPE: DWORD = 0xFFFFFFFF; |
| 2751 |
pub const CALG_OID_INFO_CNG_ONLY: ALG_ID = 0xFFFFFFFF; |
| 2752 |
pub const CALG_OID_INFO_PARAMETERS: ALG_ID = 0xFFFFFFFE; |
| 2753 |
#[inline] |
| 2754 |
pub fn IS_SPECIAL_OID_INFO_ALGID(Algid: ALG_ID) -> bool { |
| 2755 |
Algid >= CALG_OID_INFO_PARAMETERS |
| 2756 |
} |
| 2757 |
pub const CRYPT_OID_INFO_HASH_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoHashParameters"; |
| 2758 |
pub const CRYPT_OID_INFO_ECC_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoECCParameters"; |
| 2759 |
pub const CRYPT_OID_INFO_MGF1_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoMgf1Parameters"; |
| 2760 |
pub const CRYPT_OID_INFO_NO_SIGN_ALGORITHM: &'static str = "CryptOIDInfoNoSign"; |
| 2761 |
pub const CRYPT_OID_INFO_OAEP_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoOAEPParameters"; |
| 2762 |
pub const CRYPT_OID_INFO_ECC_WRAP_PARAMETERS_ALGORITHM: &'static str |
| 2763 |
= "CryptOIDInfoECCWrapParameters"; |
| 2764 |
pub const CRYPT_OID_INFO_NO_PARAMETERS_ALGORITHM: &'static str = "CryptOIDInfoNoParameters"; |
| 2765 |
UNION!{union CRYPT_OID_INFO_u { |
| 2766 |
[u32; 1], |
| 2767 |
dwValue dwValue_mut: DWORD, |
| 2768 |
Algid Algid_mut: ALG_ID, |
| 2769 |
dwLength dwLength_mut: DWORD, |
| 2770 |
}} |
| 2771 |
STRUCT!{struct CRYPT_OID_INFO { |
| 2772 |
cbSize: DWORD, |
| 2773 |
oszOID: LPCSTR, |
| 2774 |
pwszName: LPCWSTR, |
| 2775 |
dwGroupId: DWORD, |
| 2776 |
u: CRYPT_OID_INFO_u, |
| 2777 |
ExtraInfo: CRYPT_DATA_BLOB, |
| 2778 |
pwszCNGAlgid: LPCWSTR, |
| 2779 |
pwszCNGExtraAlgid: LPCWSTR, |
| 2780 |
}} |
| 2781 |
pub type PCRYPT_OID_INFO = *mut CRYPT_OID_INFO; |
| 2782 |
pub type PCCRYPT_OID_INFO = *const CRYPT_OID_INFO; |
| 2783 |
pub const CRYPT_HASH_ALG_OID_GROUP_ID: DWORD = 1; |
| 2784 |
pub const CRYPT_ENCRYPT_ALG_OID_GROUP_ID: DWORD = 2; |
| 2785 |
pub const CRYPT_PUBKEY_ALG_OID_GROUP_ID: DWORD = 3; |
| 2786 |
pub const CRYPT_SIGN_ALG_OID_GROUP_ID: DWORD = 4; |
| 2787 |
pub const CRYPT_RDN_ATTR_OID_GROUP_ID: DWORD = 5; |
| 2788 |
pub const CRYPT_EXT_OR_ATTR_OID_GROUP_ID: DWORD = 6; |
| 2789 |
pub const CRYPT_ENHKEY_USAGE_OID_GROUP_ID: DWORD = 7; |
| 2790 |
pub const CRYPT_POLICY_OID_GROUP_ID: DWORD = 8; |
| 2791 |
pub const CRYPT_TEMPLATE_OID_GROUP_ID: DWORD = 9; |
| 2792 |
pub const CRYPT_KDF_OID_GROUP_ID: DWORD = 10; |
| 2793 |
pub const CRYPT_LAST_OID_GROUP_ID: DWORD = 10; |
| 2794 |
pub const CRYPT_FIRST_ALG_OID_GROUP_ID: DWORD = CRYPT_HASH_ALG_OID_GROUP_ID; |
| 2795 |
pub const CRYPT_LAST_ALG_OID_GROUP_ID: DWORD = CRYPT_SIGN_ALG_OID_GROUP_ID; |
| 2796 |
pub const CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG: DWORD = 0x00000001; |
| 2797 |
pub const CRYPT_OID_USE_PUBKEY_PARA_FOR_PKCS7_FLAG: DWORD = 0x00000002; |
| 2798 |
pub const CRYPT_OID_NO_NULL_ALGORITHM_PARA_FLAG: DWORD = 0x00000004; |
| 2799 |
pub const CRYPT_OID_PUBKEY_SIGN_ONLY_FLAG: DWORD = 0x80000000; |
| 2800 |
pub const CRYPT_OID_PUBKEY_ENCRYPT_ONLY_FLAG: DWORD = 0x40000000; |
| 2801 |
pub const CRYPT_OID_USE_CURVE_NAME_FOR_ENCODE_FLAG: DWORD = 0x20000000; |
| 2802 |
pub const CRYPT_OID_USE_CURVE_PARAMETERS_FOR_ENCODE_FLAG: DWORD = 0x10000000; |
| 2803 |
extern "system" { |
| 2804 |
pub fn CryptFindOIDInfo( |
| 2805 |
dwKeyType: DWORD, |
| 2806 |
pvKey: *mut c_void, |
| 2807 |
dwGroupId: DWORD, |
| 2808 |
) -> PCCRYPT_OID_INFO; |
| 2809 |
} |
| 2810 |
pub const CRYPT_OID_INFO_OID_KEY: DWORD = 1; |
| 2811 |
pub const CRYPT_OID_INFO_NAME_KEY: DWORD = 2; |
| 2812 |
pub const CRYPT_OID_INFO_ALGID_KEY: DWORD = 3; |
| 2813 |
pub const CRYPT_OID_INFO_SIGN_KEY: DWORD = 4; |
| 2814 |
pub const CRYPT_OID_INFO_CNG_ALGID_KEY: DWORD = 5; |
| 2815 |
pub const CRYPT_OID_INFO_CNG_SIGN_KEY: DWORD = 6; |
| 2816 |
pub const CRYPT_OID_INFO_OID_KEY_FLAGS_MASK: DWORD = 0xFFFF0000; |
| 2817 |
pub const CRYPT_OID_INFO_PUBKEY_SIGN_KEY_FLAG: DWORD = 0x80000000; |
| 2818 |
pub const CRYPT_OID_INFO_PUBKEY_ENCRYPT_KEY_FLAG: DWORD = 0x40000000; |
| 2819 |
pub const CRYPT_OID_DISABLE_SEARCH_DS_FLAG: DWORD = 0x80000000; |
| 2820 |
pub const CRYPT_OID_PREFER_CNG_ALGID_FLAG: DWORD = 0x40000000; |
| 2821 |
pub const CRYPT_OID_INFO_OID_GROUP_BIT_LEN_MASK: DWORD = 0x0FFF0000; |
| 2822 |
pub const CRYPT_OID_INFO_OID_GROUP_BIT_LEN_SHIFT: DWORD = 16; |
| 2823 |
extern "system" { |
| 2824 |
pub fn CryptRegisterOIDInfo( |
| 2825 |
pInfo: PCCRYPT_OID_INFO, |
| 2826 |
dwFlags: DWORD, |
| 2827 |
) -> BOOL; |
| 2828 |
pub fn CryptUnregisterOIDInfo( |
| 2829 |
pInfo: PCCRYPT_OID_INFO, |
| 2830 |
) -> BOOL; |
| 2831 |
} |
| 2832 |
FN!{stdcall PFN_CRYPT_ENUM_OID_INFO( |
| 2833 |
pInfo: PCCRYPT_OID_INFO, |
| 2834 |
pvArg: *mut c_void, |
| 2835 |
) -> BOOL} |
| 2836 |
extern "system" { |
| 2837 |
pub fn CryptEnumOIDInfo( |
| 2838 |
dwGroupId: DWORD, |
| 2839 |
dwFlags: DWORD, |
| 2840 |
pvArg: *mut c_void, |
| 2841 |
pfnEnumOIDInfo: PFN_CRYPT_ENUM_OID_INFO, |
| 2842 |
) -> BOOL; |
| 2843 |
pub fn CryptFindLocalizedName( |
| 2844 |
pwszCryptName: LPCWSTR, |
| 2845 |
) -> LPCWSTR; |
| 2846 |
} |
| 2847 |
pub const CRYPT_LOCALIZED_NAME_ENCODING_TYPE: DWORD = 0; |
| 2848 |
pub const CRYPT_LOCALIZED_NAME_OID: &'static str = "LocalizedNames"; |
| 2849 |
STRUCT!{struct CERT_STRONG_SIGN_SERIALIZED_INFO { |
| 2850 |
dwFlags: DWORD, |
| 2851 |
pwszCNGSignHashAlgids: LPWSTR, |
| 2852 |
pwszCNGPubKeyMinBitLengths: LPWSTR, |
| 2853 |
}} |
| 2854 |
pub type PCERT_STRONG_SIGN_SERIALIZED_INFO = *mut CERT_STRONG_SIGN_SERIALIZED_INFO; |
| 2855 |
pub const CERT_STRONG_SIGN_ECDSA_ALGORITHM: &'static str = "ECDSA"; |
| 2856 |
UNION!{union CERT_STRONG_SIGN_PARA_u { |
| 2857 |
[usize; 1], |
| 2858 |
pvInfo pvInfo_mut: *mut c_void, |
| 2859 |
pSerializedInfo pSerializedInfo_mut: PCERT_STRONG_SIGN_SERIALIZED_INFO, |
| 2860 |
pszOID pszOID_mut: LPSTR, |
| 2861 |
}} |
| 2862 |
STRUCT!{struct CERT_STRONG_SIGN_PARA { |
| 2863 |
cbSize: DWORD, |
| 2864 |
dwInfoChoice: DWORD, |
| 2865 |
u: CERT_STRONG_SIGN_PARA_u, |
| 2866 |
}} |
| 2867 |
pub type PCERT_STRONG_SIGN_PARA = *mut CERT_STRONG_SIGN_PARA; |
| 2868 |
pub type PCCERT_STRONG_SIGN_PARA = *const CERT_STRONG_SIGN_PARA; |
| 2869 |
pub const CERT_STRONG_SIGN_SERIALIZED_INFO_CHOICE: DWORD = 1; |
| 2870 |
pub const CERT_STRONG_SIGN_OID_INFO_CHOICE: DWORD = 2; |
| 2871 |
pub const CERT_STRONG_SIGN_ENABLE_CRL_CHECK: DWORD = 0x1; |
| 2872 |
pub const CERT_STRONG_SIGN_ENABLE_OCSP_CHECK: DWORD = 0x2; |
| 2873 |
pub const szOID_CERT_STRONG_SIGN_OS_PREFIX: &'static str = "1.3.6.1.4.1.311.72.1."; |
| 2874 |
pub const szOID_CERT_STRONG_SIGN_OS_1: &'static str = "1.3.6.1.4.1.311.72.1.1"; |
| 2875 |
pub const szOID_CERT_STRONG_SIGN_OS_CURRENT: &'static str = szOID_CERT_STRONG_SIGN_OS_1; |
| 2876 |
pub const szOID_CERT_STRONG_KEY_OS_PREFIX: &'static str = "1.3.6.1.4.1.311.72.2."; |
| 2877 |
pub const szOID_CERT_STRONG_KEY_OS_1: &'static str = "1.3.6.1.4.1.311.72.2.1"; |
| 2878 |
pub const szOID_CERT_STRONG_KEY_OS_CURRENT: &'static str = szOID_CERT_STRONG_KEY_OS_1; |
| 2879 |
pub type HCRYPTMSG = *mut c_void; |
| 2880 |
pub const szOID_PKCS_7_DATA: &'static str = "1.2.840.113549.1.7.1"; |
| 2881 |
pub const szOID_PKCS_7_SIGNED: &'static str = "1.2.840.113549.1.7.2"; |
| 2882 |
pub const szOID_PKCS_7_ENVELOPED: &'static str = "1.2.840.113549.1.7.3"; |
| 2883 |
pub const szOID_PKCS_7_SIGNEDANDENVELOPED: &'static str = "1.2.840.113549.1.7.4"; |
| 2884 |
pub const szOID_PKCS_7_DIGESTED: &'static str = "1.2.840.113549.1.7.5"; |
| 2885 |
pub const szOID_PKCS_7_ENCRYPTED: &'static str = "1.2.840.113549.1.7.6"; |
| 2886 |
pub const szOID_PKCS_9_CONTENT_TYPE: &'static str = "1.2.840.113549.1.9.3"; |
| 2887 |
pub const szOID_PKCS_9_MESSAGE_DIGEST: &'static str = "1.2.840.113549.1.9.4"; |
| 2888 |
pub const CMSG_DATA: DWORD = 1; |
| 2889 |
pub const CMSG_SIGNED: DWORD = 2; |
| 2890 |
pub const CMSG_ENVELOPED: DWORD = 3; |
| 2891 |
pub const CMSG_SIGNED_AND_ENVELOPED: DWORD = 4; |
| 2892 |
pub const CMSG_HASHED: DWORD = 5; |
| 2893 |
pub const CMSG_ENCRYPTED: DWORD = 6; |
| 2894 |
pub const CMSG_ALL_FLAGS: DWORD = !0; |
| 2895 |
pub const CMSG_DATA_FLAG: DWORD = 1 << CMSG_DATA; |
| 2896 |
pub const CMSG_SIGNED_FLAG: DWORD = 1 << CMSG_SIGNED; |
| 2897 |
pub const CMSG_ENVELOPED_FLAG: DWORD = 1 << CMSG_ENVELOPED; |
| 2898 |
pub const CMSG_SIGNED_AND_ENVELOPED_FLAG: DWORD = 1 << CMSG_SIGNED_AND_ENVELOPED; |
| 2899 |
pub const CMSG_HASHED_FLAG: DWORD = 1 << CMSG_HASHED; |
| 2900 |
pub const CMSG_ENCRYPTED_FLAG: DWORD = 1 << CMSG_ENCRYPTED; |
| 2901 |
STRUCT!{struct CERT_ISSUER_SERIAL_NUMBER { |
| 2902 |
Issuer: CERT_NAME_BLOB, |
| 2903 |
SerialNumber: CRYPT_INTEGER_BLOB, |
| 2904 |
}} |
| 2905 |
pub type PCERT_ISSUER_SERIAL_NUMBER = *mut CERT_ISSUER_SERIAL_NUMBER; |
| 2906 |
UNION!{union CERT_ID_u { |
| 2907 |
[usize; 4], |
| 2908 |
IssuerSerialNumber IssuerSerialNumber_mut: CERT_ISSUER_SERIAL_NUMBER, |
| 2909 |
KeyId KeyId_mut: CRYPT_HASH_BLOB, |
| 2910 |
HashId HashId_mut: CRYPT_HASH_BLOB, |
| 2911 |
}} |
| 2912 |
STRUCT!{struct CERT_ID { |
| 2913 |
dwIdChoice: DWORD, |
| 2914 |
u: CERT_ID_u, |
| 2915 |
}} |
| 2916 |
pub type PCERT_ID = *mut CERT_ID; |
| 2917 |
pub const CERT_ID_ISSUER_SERIAL_NUMBER: DWORD = 1; |
| 2918 |
pub const CERT_ID_KEY_IDENTIFIER: DWORD = 2; |
| 2919 |
pub const CERT_ID_SHA1_HASH: DWORD = 3; |
| 2920 |
UNION!{union CMSG_SIGNER_ENCODE_INFO_u { |
| 2921 |
[usize; 1], |
| 2922 |
hCryptProv hCryptProv_mut: HCRYPTPROV, |
| 2923 |
hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, |
| 2924 |
hBCryptKey hBCryptKey_mut: BCRYPT_KEY_HANDLE, |
| 2925 |
}} |
| 2926 |
STRUCT!{struct CMSG_SIGNER_ENCODE_INFO { |
| 2927 |
cbSize: DWORD, |
| 2928 |
pCertInfo: PCERT_INFO, |
| 2929 |
u: CMSG_SIGNER_ENCODE_INFO_u, |
| 2930 |
dwKeySpec: DWORD, |
| 2931 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2932 |
pvHashAuxInfo: *mut c_void, |
| 2933 |
cAuthAttr: DWORD, |
| 2934 |
rgAuthAttr: PCRYPT_ATTRIBUTE, |
| 2935 |
cUnauthAttr: DWORD, |
| 2936 |
rgUnauthAttr: PCRYPT_ATTRIBUTE, |
| 2937 |
SignerId: CERT_ID, |
| 2938 |
HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2939 |
pvHashEncryptionAuxInfo: *mut c_void, |
| 2940 |
}} |
| 2941 |
pub type PCMSG_SIGNER_ENCODE_INFO = *mut CMSG_SIGNER_ENCODE_INFO; |
| 2942 |
STRUCT!{struct CMSG_SIGNED_ENCODE_INFO { |
| 2943 |
cbSize: DWORD, |
| 2944 |
cSigners: DWORD, |
| 2945 |
rgSigners: PCMSG_SIGNER_ENCODE_INFO, |
| 2946 |
cCertEncoded: DWORD, |
| 2947 |
rgCertEncoded: PCERT_BLOB, |
| 2948 |
cCrlEncoded: DWORD, |
| 2949 |
rgCrlEncoded: PCRL_BLOB, |
| 2950 |
cAttrCertEncoded: DWORD, |
| 2951 |
rgAttrCertEncoded: PCERT_BLOB, |
| 2952 |
}} |
| 2953 |
pub type PCMSG_SIGNED_ENCODE_INFO = *mut CMSG_SIGNED_ENCODE_INFO; |
| 2954 |
pub type PCMSG_RECIPIENT_ENCODE_INFO = *mut CMSG_RECIPIENT_ENCODE_INFO; |
| 2955 |
STRUCT!{struct CMSG_ENVELOPED_ENCODE_INFO { |
| 2956 |
cbSize: DWORD, |
| 2957 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 2958 |
ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2959 |
pvEncryptionAuxInfo: *mut c_void, |
| 2960 |
cRecipients: DWORD, |
| 2961 |
rgpRecipients: *mut PCERT_INFO, |
| 2962 |
rgCmsRecipients: PCMSG_RECIPIENT_ENCODE_INFO, |
| 2963 |
cCertEncoded: DWORD, |
| 2964 |
rgCertEncoded: PCERT_BLOB, |
| 2965 |
cCrlEncoded: DWORD, |
| 2966 |
rgCrlEncoded: PCRL_BLOB, |
| 2967 |
cAttrCertEncoded: DWORD, |
| 2968 |
rgAttrCertEncoded: PCERT_BLOB, |
| 2969 |
cUnprotectedAttr: DWORD, |
| 2970 |
rgUnprotectedAttr: PCRYPT_ATTRIBUTE, |
| 2971 |
}} |
| 2972 |
pub type PCMSG_ENVELOPED_ENCODE_INFO = *mut CMSG_ENVELOPED_ENCODE_INFO; |
| 2973 |
STRUCT!{struct CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO { |
| 2974 |
cbSize: DWORD, |
| 2975 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2976 |
pvKeyEncryptionAuxInfo: *mut c_void, |
| 2977 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 2978 |
RecipientPublicKey: CRYPT_BIT_BLOB, |
| 2979 |
RecipientId: CERT_ID, |
| 2980 |
}} |
| 2981 |
pub type PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO = *mut CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO; |
| 2982 |
STRUCT!{struct CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO { |
| 2983 |
cbSize: DWORD, |
| 2984 |
RecipientPublicKey: CRYPT_BIT_BLOB, |
| 2985 |
RecipientId: CERT_ID, |
| 2986 |
Date: FILETIME, |
| 2987 |
pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, |
| 2988 |
}} |
| 2989 |
pub type PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO = *mut CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO; |
| 2990 |
UNION!{union CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO_u { |
| 2991 |
[usize; 1], |
| 2992 |
pEphemeralAlgorithm pEphemeralAlgorithm_mut: PCRYPT_ALGORITHM_IDENTIFIER, |
| 2993 |
pSenderId pSenderId_mut: PCERT_ID, |
| 2994 |
}} |
| 2995 |
STRUCT!{struct CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO { |
| 2996 |
cbSize: DWORD, |
| 2997 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 2998 |
pvKeyEncryptionAuxInfo: *mut c_void, |
| 2999 |
KeyWrapAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3000 |
pvKeyWrapAuxInfo: *mut c_void, |
| 3001 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3002 |
dwKeySpec: DWORD, |
| 3003 |
dwKeyChoice: DWORD, |
| 3004 |
u: CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO_u, |
| 3005 |
UserKeyingMaterial: CRYPT_DATA_BLOB, |
| 3006 |
cRecipientEncryptedKeys: DWORD, |
| 3007 |
rgpRecipientEncryptedKeys: *mut PCMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO, |
| 3008 |
}} |
| 3009 |
pub type PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO = *mut CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO; |
| 3010 |
pub const CMSG_KEY_AGREE_EPHEMERAL_KEY_CHOICE: DWORD = 1; |
| 3011 |
pub const CMSG_KEY_AGREE_STATIC_KEY_CHOICE: DWORD = 2; |
| 3012 |
UNION!{union CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO_u { |
| 3013 |
[usize; 1], |
| 3014 |
hKeyEncryptionKey hKeyEncryptionKey_mut: HCRYPTKEY, |
| 3015 |
pvKeyEncryptionKey pvKeyEncryptionKey_mut: *mut c_void, |
| 3016 |
}} |
| 3017 |
STRUCT!{struct CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO { |
| 3018 |
cbSize: DWORD, |
| 3019 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3020 |
pvKeyEncryptionAuxInfo: *mut c_void, |
| 3021 |
hCryptProv: HCRYPTPROV, |
| 3022 |
dwKeyChoice: DWORD, |
| 3023 |
u: CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO_u, |
| 3024 |
KeyId: CRYPT_DATA_BLOB, |
| 3025 |
Date: FILETIME, |
| 3026 |
pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, |
| 3027 |
}} |
| 3028 |
pub type PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO = *mut CMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO; |
| 3029 |
pub const CMSG_MAIL_LIST_HANDLE_KEY_CHOICE: DWORD = 1; |
| 3030 |
UNION!{union CMSG_RECIPIENT_ENCODE_INFO_u { |
| 3031 |
[usize; 1], |
| 3032 |
pKeyTrans pKeyTrans_mut: PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, |
| 3033 |
pKeyAgree pKeyAgree_mut: PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, |
| 3034 |
pMailList pMailList_mut: PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, |
| 3035 |
}} |
| 3036 |
STRUCT!{struct CMSG_RECIPIENT_ENCODE_INFO { |
| 3037 |
dwRecipientChoice: DWORD, |
| 3038 |
u: CMSG_RECIPIENT_ENCODE_INFO_u, |
| 3039 |
}} |
| 3040 |
pub const CMSG_KEY_TRANS_RECIPIENT: DWORD = 1; |
| 3041 |
pub const CMSG_KEY_AGREE_RECIPIENT: DWORD = 2; |
| 3042 |
pub const CMSG_MAIL_LIST_RECIPIENT: DWORD = 3; |
| 3043 |
STRUCT!{struct CMSG_RC2_AUX_INFO { |
| 3044 |
cbSize: DWORD, |
| 3045 |
dwBitLen: DWORD, |
| 3046 |
}} |
| 3047 |
pub type PCMSG_RC2_AUX_INFO = *mut CMSG_RC2_AUX_INFO; |
| 3048 |
STRUCT!{struct CMSG_SP3_COMPATIBLE_AUX_INFO { |
| 3049 |
cbSize: DWORD, |
| 3050 |
dwFlags: DWORD, |
| 3051 |
}} |
| 3052 |
pub type PCMSG_SP3_COMPATIBLE_AUX_INFO = *mut CMSG_SP3_COMPATIBLE_AUX_INFO; |
| 3053 |
pub const CMSG_SP3_COMPATIBLE_ENCRYPT_FLAG: DWORD = 0x80000000; |
| 3054 |
STRUCT!{struct CMSG_RC4_AUX_INFO { |
| 3055 |
cbSize: DWORD, |
| 3056 |
dwBitLen: DWORD, |
| 3057 |
}} |
| 3058 |
pub type PCMSG_RC4_AUX_INFO = *mut CMSG_RC4_AUX_INFO; |
| 3059 |
pub const CMSG_RC4_NO_SALT_FLAG: DWORD = 0x40000000; |
| 3060 |
STRUCT!{struct CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO { |
| 3061 |
cbSize: DWORD, |
| 3062 |
SignedInfo: CMSG_SIGNED_ENCODE_INFO, |
| 3063 |
EnvelopedInfo: CMSG_ENVELOPED_ENCODE_INFO, |
| 3064 |
}} |
| 3065 |
pub type PCMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO = *mut CMSG_SIGNED_AND_ENVELOPED_ENCODE_INFO; |
| 3066 |
STRUCT!{struct CMSG_HASHED_ENCODE_INFO { |
| 3067 |
cbSize: DWORD, |
| 3068 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3069 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3070 |
pvHashAuxInfo: *mut c_void, |
| 3071 |
}} |
| 3072 |
pub type PCMSG_HASHED_ENCODE_INFO = *mut CMSG_HASHED_ENCODE_INFO; |
| 3073 |
STRUCT!{struct CMSG_ENCRYPTED_ENCODE_INFO { |
| 3074 |
cbSize: DWORD, |
| 3075 |
ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3076 |
pvEncryptionAuxInfo: *mut c_void, |
| 3077 |
}} |
| 3078 |
pub type PCMSG_ENCRYPTED_ENCODE_INFO = *mut CMSG_ENCRYPTED_ENCODE_INFO; |
| 3079 |
FN!{stdcall PFN_CMSG_STREAM_OUTPUT( |
| 3080 |
pvArg: *const c_void, |
| 3081 |
pbData: *mut BYTE, |
| 3082 |
cbData: DWORD, |
| 3083 |
fFinal: BOOL, |
| 3084 |
) -> BOOL} |
| 3085 |
pub const CMSG_INDEFINITE_LENGTH: DWORD = 0xFFFFFFFF; |
| 3086 |
STRUCT!{struct CMSG_STREAM_INFO { |
| 3087 |
cbContent: DWORD, |
| 3088 |
pfnStreamOutput: PFN_CMSG_STREAM_OUTPUT, |
| 3089 |
pvArg: *mut c_void, |
| 3090 |
}} |
| 3091 |
pub type PCMSG_STREAM_INFO = *mut CMSG_STREAM_INFO; |
| 3092 |
pub const CMSG_BARE_CONTENT_FLAG: DWORD = 0x00000001; |
| 3093 |
pub const CMSG_LENGTH_ONLY_FLAG: DWORD = 0x00000002; |
| 3094 |
pub const CMSG_DETACHED_FLAG: DWORD = 0x00000004; |
| 3095 |
pub const CMSG_AUTHENTICATED_ATTRIBUTES_FLAG: DWORD = 0x00000008; |
| 3096 |
pub const CMSG_CONTENTS_OCTETS_FLAG: DWORD = 0x00000010; |
| 3097 |
pub const CMSG_MAX_LENGTH_FLAG: DWORD = 0x00000020; |
| 3098 |
pub const CMSG_CMS_ENCAPSULATED_CONTENT_FLAG: DWORD = 0x00000040; |
| 3099 |
pub const CMSG_SIGNED_DATA_NO_SIGN_FLAG: DWORD = 0x00000080; |
| 3100 |
pub const CMSG_CRYPT_RELEASE_CONTEXT_FLAG: DWORD = 0x00008000; |
| 3101 |
extern "system" { |
| 3102 |
pub fn CryptMsgOpenToEncode( |
| 3103 |
dwMsgEncodingType: DWORD, |
| 3104 |
dwFlags: DWORD, |
| 3105 |
dwMsgType: DWORD, |
| 3106 |
pvMsgEncodeInfo: *mut c_void, |
| 3107 |
pszInnerContentObjID: LPSTR, |
| 3108 |
pStreamInfo: PCMSG_STREAM_INFO, |
| 3109 |
) -> HCRYPTMSG; |
| 3110 |
pub fn CryptMsgCalculateEncodedLength( |
| 3111 |
dwMsgEncodingType: DWORD, |
| 3112 |
dwFlags: DWORD, |
| 3113 |
dwMsgType: DWORD, |
| 3114 |
pvMsgEncodeInfo: *const c_void, |
| 3115 |
pszInnerContentObjID: LPSTR, |
| 3116 |
cbData: DWORD, |
| 3117 |
) -> DWORD; |
| 3118 |
pub fn CryptMsgOpenToDecode( |
| 3119 |
dwMsgEncodingType: DWORD, |
| 3120 |
dwFlags: DWORD, |
| 3121 |
dwMsgType: DWORD, |
| 3122 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3123 |
pRecipientInfo: PCERT_INFO, |
| 3124 |
pStreamInfo: PCMSG_STREAM_INFO, |
| 3125 |
) -> HCRYPTMSG; |
| 3126 |
pub fn CryptMsgDuplicate( |
| 3127 |
hCryptMsg: HCRYPTMSG, |
| 3128 |
) -> HCRYPTMSG; |
| 3129 |
pub fn CryptMsgClose( |
| 3130 |
hCryptMsg: HCRYPTMSG, |
| 3131 |
) -> BOOL; |
| 3132 |
pub fn CryptMsgUpdate( |
| 3133 |
hCryptMsg: HCRYPTMSG, |
| 3134 |
pbData: *const BYTE, |
| 3135 |
cbData: DWORD, |
| 3136 |
fFinal: BOOL, |
| 3137 |
) -> BOOL; |
| 3138 |
pub fn CryptMsgGetParam( |
| 3139 |
hCryptMsg: HCRYPTMSG, |
| 3140 |
dwParamType: DWORD, |
| 3141 |
dwIndex: DWORD, |
| 3142 |
pvData: *mut c_void, |
| 3143 |
pcbData: *mut DWORD, |
| 3144 |
) -> BOOL; |
| 3145 |
} |
| 3146 |
pub const CMSG_TYPE_PARAM: DWORD = 1; |
| 3147 |
pub const CMSG_CONTENT_PARAM: DWORD = 2; |
| 3148 |
pub const CMSG_BARE_CONTENT_PARAM: DWORD = 3; |
| 3149 |
pub const CMSG_INNER_CONTENT_TYPE_PARAM: DWORD = 4; |
| 3150 |
pub const CMSG_SIGNER_COUNT_PARAM: DWORD = 5; |
| 3151 |
pub const CMSG_SIGNER_INFO_PARAM: DWORD = 6; |
| 3152 |
pub const CMSG_SIGNER_CERT_INFO_PARAM: DWORD = 7; |
| 3153 |
pub const CMSG_SIGNER_HASH_ALGORITHM_PARAM: DWORD = 8; |
| 3154 |
pub const CMSG_SIGNER_AUTH_ATTR_PARAM: DWORD = 9; |
| 3155 |
pub const CMSG_SIGNER_UNAUTH_ATTR_PARAM: DWORD = 10; |
| 3156 |
pub const CMSG_CERT_COUNT_PARAM: DWORD = 11; |
| 3157 |
pub const CMSG_CERT_PARAM: DWORD = 12; |
| 3158 |
pub const CMSG_CRL_COUNT_PARAM: DWORD = 13; |
| 3159 |
pub const CMSG_CRL_PARAM: DWORD = 14; |
| 3160 |
pub const CMSG_ENVELOPE_ALGORITHM_PARAM: DWORD = 15; |
| 3161 |
pub const CMSG_RECIPIENT_COUNT_PARAM: DWORD = 17; |
| 3162 |
pub const CMSG_RECIPIENT_INDEX_PARAM: DWORD = 18; |
| 3163 |
pub const CMSG_RECIPIENT_INFO_PARAM: DWORD = 19; |
| 3164 |
pub const CMSG_HASH_ALGORITHM_PARAM: DWORD = 20; |
| 3165 |
pub const CMSG_HASH_DATA_PARAM: DWORD = 21; |
| 3166 |
pub const CMSG_COMPUTED_HASH_PARAM: DWORD = 22; |
| 3167 |
pub const CMSG_ENCRYPT_PARAM: DWORD = 26; |
| 3168 |
pub const CMSG_ENCRYPTED_DIGEST: DWORD = 27; |
| 3169 |
pub const CMSG_ENCODED_SIGNER: DWORD = 28; |
| 3170 |
pub const CMSG_ENCODED_MESSAGE: DWORD = 29; |
| 3171 |
pub const CMSG_VERSION_PARAM: DWORD = 30; |
| 3172 |
pub const CMSG_ATTR_CERT_COUNT_PARAM: DWORD = 31; |
| 3173 |
pub const CMSG_ATTR_CERT_PARAM: DWORD = 32; |
| 3174 |
pub const CMSG_CMS_RECIPIENT_COUNT_PARAM: DWORD = 33; |
| 3175 |
pub const CMSG_CMS_RECIPIENT_INDEX_PARAM: DWORD = 34; |
| 3176 |
pub const CMSG_CMS_RECIPIENT_ENCRYPTED_KEY_INDEX_PARAM: DWORD = 35; |
| 3177 |
pub const CMSG_CMS_RECIPIENT_INFO_PARAM: DWORD = 36; |
| 3178 |
pub const CMSG_UNPROTECTED_ATTR_PARAM: DWORD = 37; |
| 3179 |
pub const CMSG_SIGNER_CERT_ID_PARAM: DWORD = 38; |
| 3180 |
pub const CMSG_CMS_SIGNER_INFO_PARAM: DWORD = 39; |
| 3181 |
STRUCT!{struct CMSG_SIGNER_INFO { |
| 3182 |
dwVersion: DWORD, |
| 3183 |
Issuer: CERT_NAME_BLOB, |
| 3184 |
SerialNumber: CRYPT_INTEGER_BLOB, |
| 3185 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3186 |
HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3187 |
EncryptedHash: CRYPT_DATA_BLOB, |
| 3188 |
AuthAttrs: CRYPT_ATTRIBUTES, |
| 3189 |
UnauthAttrs: CRYPT_ATTRIBUTES, |
| 3190 |
}} |
| 3191 |
pub type PCMSG_SIGNER_INFO = *mut CMSG_SIGNER_INFO; |
| 3192 |
STRUCT!{struct CMSG_CMS_SIGNER_INFO { |
| 3193 |
dwVersion: DWORD, |
| 3194 |
SignerId: CERT_ID, |
| 3195 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3196 |
HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3197 |
EncryptedHash: CRYPT_DATA_BLOB, |
| 3198 |
AuthAttrs: CRYPT_ATTRIBUTES, |
| 3199 |
UnauthAttrs: CRYPT_ATTRIBUTES, |
| 3200 |
}} |
| 3201 |
pub type PCMSG_CMS_SIGNER_INFO = *mut CMSG_CMS_SIGNER_INFO; |
| 3202 |
pub type CMSG_ATTR = CRYPT_ATTRIBUTES; |
| 3203 |
pub type PCMSG_ATTR = *mut CRYPT_ATTRIBUTES; |
| 3204 |
pub const CMSG_SIGNED_DATA_V1: DWORD = 1; |
| 3205 |
pub const CMSG_SIGNED_DATA_V3: DWORD = 3; |
| 3206 |
pub const CMSG_SIGNED_DATA_PKCS_1_5_VERSION: DWORD = CMSG_SIGNED_DATA_V1; |
| 3207 |
pub const CMSG_SIGNED_DATA_CMS_VERSION: DWORD = CMSG_SIGNED_DATA_V3; |
| 3208 |
pub const CMSG_SIGNER_INFO_V1: DWORD = 1; |
| 3209 |
pub const CMSG_SIGNER_INFO_V3: DWORD = 3; |
| 3210 |
pub const CMSG_SIGNER_INFO_PKCS_1_5_VERSION: DWORD = CMSG_SIGNER_INFO_V1; |
| 3211 |
pub const CMSG_SIGNER_INFO_CMS_VERSION: DWORD = CMSG_SIGNER_INFO_V3; |
| 3212 |
pub const CMSG_HASHED_DATA_V0: DWORD = 0; |
| 3213 |
pub const CMSG_HASHED_DATA_V2: DWORD = 2; |
| 3214 |
pub const CMSG_HASHED_DATA_PKCS_1_5_VERSION: DWORD = CMSG_HASHED_DATA_V0; |
| 3215 |
pub const CMSG_HASHED_DATA_CMS_VERSION: DWORD = CMSG_HASHED_DATA_V2; |
| 3216 |
pub const CMSG_ENVELOPED_DATA_V0: DWORD = 0; |
| 3217 |
pub const CMSG_ENVELOPED_DATA_V2: DWORD = 2; |
| 3218 |
pub const CMSG_ENVELOPED_DATA_PKCS_1_5_VERSION: DWORD = CMSG_ENVELOPED_DATA_V0; |
| 3219 |
pub const CMSG_ENVELOPED_DATA_CMS_VERSION: DWORD = CMSG_ENVELOPED_DATA_V2; |
| 3220 |
STRUCT!{struct CMSG_KEY_TRANS_RECIPIENT_INFO { |
| 3221 |
dwVersion: DWORD, |
| 3222 |
RecipientId: CERT_ID, |
| 3223 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3224 |
EncryptedKey: CRYPT_DATA_BLOB, |
| 3225 |
}} |
| 3226 |
pub type PCMSG_KEY_TRANS_RECIPIENT_INFO = *mut CMSG_KEY_TRANS_RECIPIENT_INFO; |
| 3227 |
STRUCT!{struct CMSG_RECIPIENT_ENCRYPTED_KEY_INFO { |
| 3228 |
RecipientId: CERT_ID, |
| 3229 |
EncryptedKey: CRYPT_DATA_BLOB, |
| 3230 |
Date: FILETIME, |
| 3231 |
pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, |
| 3232 |
}} |
| 3233 |
pub type PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO = *mut CMSG_RECIPIENT_ENCRYPTED_KEY_INFO; |
| 3234 |
UNION!{union CMSG_KEY_AGREE_RECIPIENT_INFO_u { |
| 3235 |
[usize; 6], |
| 3236 |
OriginatorCertId OriginatorCertId_mut: CERT_ID, |
| 3237 |
OriginatorPublicKeyInfo OriginatorPublicKeyInfo_mut: CERT_PUBLIC_KEY_INFO, |
| 3238 |
}} |
| 3239 |
STRUCT!{struct CMSG_KEY_AGREE_RECIPIENT_INFO { |
| 3240 |
dwVersion: DWORD, |
| 3241 |
dwOriginatorChoice: DWORD, |
| 3242 |
u: CMSG_KEY_AGREE_RECIPIENT_INFO_u, |
| 3243 |
UserKeyingMaterial: CRYPT_DATA_BLOB, |
| 3244 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3245 |
cRecipientEncryptedKeys: DWORD, |
| 3246 |
rgpRecipientEncryptedKeys: *mut PCMSG_RECIPIENT_ENCRYPTED_KEY_INFO, |
| 3247 |
}} |
| 3248 |
pub type PCMSG_KEY_AGREE_RECIPIENT_INFO = *mut CMSG_KEY_AGREE_RECIPIENT_INFO; |
| 3249 |
pub const CMSG_KEY_AGREE_ORIGINATOR_CERT: DWORD = 1; |
| 3250 |
pub const CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY: DWORD = 2; |
| 3251 |
STRUCT!{struct CMSG_MAIL_LIST_RECIPIENT_INFO { |
| 3252 |
dwVersion: DWORD, |
| 3253 |
KeyId: CRYPT_DATA_BLOB, |
| 3254 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3255 |
EncryptedKey: CRYPT_DATA_BLOB, |
| 3256 |
Date: FILETIME, |
| 3257 |
pOtherAttr: PCRYPT_ATTRIBUTE_TYPE_VALUE, |
| 3258 |
}} |
| 3259 |
pub type PCMSG_MAIL_LIST_RECIPIENT_INFO = *mut CMSG_MAIL_LIST_RECIPIENT_INFO; |
| 3260 |
UNION!{union CMSG_CMS_RECIPIENT_INFO_u { |
| 3261 |
[usize; 1], |
| 3262 |
pKeyTrans pKeyTrans_mut: PCMSG_KEY_TRANS_RECIPIENT_INFO, |
| 3263 |
pKeyAgree pKeyAgree_mut: PCMSG_KEY_AGREE_RECIPIENT_INFO, |
| 3264 |
pMailList pMailList_mut: PCMSG_MAIL_LIST_RECIPIENT_INFO, |
| 3265 |
}} |
| 3266 |
STRUCT!{struct CMSG_CMS_RECIPIENT_INFO { |
| 3267 |
dwRecipientChoice: DWORD, |
| 3268 |
u: CMSG_CMS_RECIPIENT_INFO_u, |
| 3269 |
}} |
| 3270 |
pub type PCMSG_CMS_RECIPIENT_INFO = *mut CMSG_CMS_RECIPIENT_INFO; |
| 3271 |
pub const CMSG_ENVELOPED_RECIPIENT_V0: DWORD = 0; |
| 3272 |
pub const CMSG_ENVELOPED_RECIPIENT_V2: DWORD = 2; |
| 3273 |
pub const CMSG_ENVELOPED_RECIPIENT_V3: DWORD = 3; |
| 3274 |
pub const CMSG_ENVELOPED_RECIPIENT_V4: DWORD = 4; |
| 3275 |
pub const CMSG_KEY_TRANS_PKCS_1_5_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V0; |
| 3276 |
pub const CMSG_KEY_TRANS_CMS_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V2; |
| 3277 |
pub const CMSG_KEY_AGREE_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V3; |
| 3278 |
pub const CMSG_MAIL_LIST_VERSION: DWORD = CMSG_ENVELOPED_RECIPIENT_V4; |
| 3279 |
extern "system" { |
| 3280 |
pub fn CryptMsgControl( |
| 3281 |
hCryptMsg: HCRYPTMSG, |
| 3282 |
dwFlags: DWORD, |
| 3283 |
dwCtrlType: DWORD, |
| 3284 |
pvCtrlPara: *const c_void, |
| 3285 |
) -> BOOL; |
| 3286 |
} |
| 3287 |
pub const CMSG_CTRL_VERIFY_SIGNATURE: DWORD = 1; |
| 3288 |
pub const CMSG_CTRL_DECRYPT: DWORD = 2; |
| 3289 |
pub const CMSG_CTRL_VERIFY_HASH: DWORD = 5; |
| 3290 |
pub const CMSG_CTRL_ADD_SIGNER: DWORD = 6; |
| 3291 |
pub const CMSG_CTRL_DEL_SIGNER: DWORD = 7; |
| 3292 |
pub const CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR: DWORD = 8; |
| 3293 |
pub const CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR: DWORD = 9; |
| 3294 |
pub const CMSG_CTRL_ADD_CERT: DWORD = 10; |
| 3295 |
pub const CMSG_CTRL_DEL_CERT: DWORD = 11; |
| 3296 |
pub const CMSG_CTRL_ADD_CRL: DWORD = 12; |
| 3297 |
pub const CMSG_CTRL_DEL_CRL: DWORD = 13; |
| 3298 |
pub const CMSG_CTRL_ADD_ATTR_CERT: DWORD = 14; |
| 3299 |
pub const CMSG_CTRL_DEL_ATTR_CERT: DWORD = 15; |
| 3300 |
pub const CMSG_CTRL_KEY_TRANS_DECRYPT: DWORD = 16; |
| 3301 |
pub const CMSG_CTRL_KEY_AGREE_DECRYPT: DWORD = 17; |
| 3302 |
pub const CMSG_CTRL_MAIL_LIST_DECRYPT: DWORD = 18; |
| 3303 |
pub const CMSG_CTRL_VERIFY_SIGNATURE_EX: DWORD = 19; |
| 3304 |
pub const CMSG_CTRL_ADD_CMS_SIGNER_INFO: DWORD = 20; |
| 3305 |
pub const CMSG_CTRL_ENABLE_STRONG_SIGNATURE: DWORD = 21; |
| 3306 |
STRUCT!{struct CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA { |
| 3307 |
cbSize: DWORD, |
| 3308 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3309 |
dwSignerIndex: DWORD, |
| 3310 |
dwSignerType: DWORD, |
| 3311 |
pvSigner: *mut c_void, |
| 3312 |
}} |
| 3313 |
pub type PCMSG_CTRL_VERIFY_SIGNATURE_EX_PARA = *mut CMSG_CTRL_VERIFY_SIGNATURE_EX_PARA; |
| 3314 |
pub const CMSG_VERIFY_SIGNER_PUBKEY: DWORD = 1; |
| 3315 |
pub const CMSG_VERIFY_SIGNER_CERT: DWORD = 2; |
| 3316 |
pub const CMSG_VERIFY_SIGNER_CHAIN: DWORD = 3; |
| 3317 |
pub const CMSG_VERIFY_SIGNER_NULL: DWORD = 4; |
| 3318 |
UNION!{union CMSG_CTRL_DECRYPT_PARA_u { |
| 3319 |
[usize; 1], |
| 3320 |
hCryptProv hCryptProv_mut: HCRYPTPROV, |
| 3321 |
hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, |
| 3322 |
}} |
| 3323 |
STRUCT!{struct CMSG_CTRL_DECRYPT_PARA { |
| 3324 |
cbSize: DWORD, |
| 3325 |
u: CMSG_CTRL_DECRYPT_PARA_u, |
| 3326 |
dwKeySpec: DWORD, |
| 3327 |
dwRecipientIndex: DWORD, |
| 3328 |
}} |
| 3329 |
pub type PCMSG_CTRL_DECRYPT_PARA = *mut CMSG_CTRL_DECRYPT_PARA; |
| 3330 |
UNION!{union CMSG_CTRL_KEY_TRANS_DECRYPT_PARA_u { |
| 3331 |
[usize; 1], |
| 3332 |
hCryptProv hCryptProv_mut: HCRYPTPROV, |
| 3333 |
hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, |
| 3334 |
}} |
| 3335 |
STRUCT!{struct CMSG_CTRL_KEY_TRANS_DECRYPT_PARA { |
| 3336 |
cbSize: DWORD, |
| 3337 |
u: CMSG_CTRL_KEY_TRANS_DECRYPT_PARA_u, |
| 3338 |
dwKeySpec: DWORD, |
| 3339 |
pKeyTrans: PCMSG_KEY_TRANS_RECIPIENT_INFO, |
| 3340 |
dwRecipientIndex: DWORD, |
| 3341 |
}} |
| 3342 |
pub type PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA = *mut CMSG_CTRL_KEY_TRANS_DECRYPT_PARA; |
| 3343 |
UNION!{union CMSG_CTRL_KEY_AGREE_DECRYPT_PARA_u { |
| 3344 |
[usize; 1], |
| 3345 |
hCryptProv hCryptProv_mut: HCRYPTPROV, |
| 3346 |
hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, |
| 3347 |
}} |
| 3348 |
STRUCT!{struct CMSG_CTRL_KEY_AGREE_DECRYPT_PARA { |
| 3349 |
cbSize: DWORD, |
| 3350 |
u: CMSG_CTRL_KEY_AGREE_DECRYPT_PARA_u, |
| 3351 |
dwKeySpec: DWORD, |
| 3352 |
pKeyAgree: PCMSG_KEY_AGREE_RECIPIENT_INFO, |
| 3353 |
dwRecipientIndex: DWORD, |
| 3354 |
dwRecipientEncryptedKeyIndex: DWORD, |
| 3355 |
OriginatorPublicKey: CRYPT_BIT_BLOB, |
| 3356 |
}} |
| 3357 |
pub type PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA = *mut CMSG_CTRL_KEY_AGREE_DECRYPT_PARA; |
| 3358 |
UNION!{union CMSG_CTRL_MAIL_LIST_DECRYPT_PARA_u { |
| 3359 |
[usize; 1], |
| 3360 |
hKeyEncryptionKey hKeyEncryptionKey_mut: HCRYPTKEY, |
| 3361 |
pvKeyEncryptionKey pvKeyEncryptionKey_mut: *mut c_void, |
| 3362 |
}} |
| 3363 |
STRUCT!{struct CMSG_CTRL_MAIL_LIST_DECRYPT_PARA { |
| 3364 |
cbSize: DWORD, |
| 3365 |
hCryptProv: HCRYPTPROV, |
| 3366 |
pMailList: PCMSG_MAIL_LIST_RECIPIENT_INFO, |
| 3367 |
dwRecipientIndex: DWORD, |
| 3368 |
dwKeyChoice: DWORD, |
| 3369 |
u: CMSG_CTRL_MAIL_LIST_DECRYPT_PARA_u, |
| 3370 |
}} |
| 3371 |
pub type PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA = *mut CMSG_CTRL_MAIL_LIST_DECRYPT_PARA; |
| 3372 |
STRUCT!{struct CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA { |
| 3373 |
cbSize: DWORD, |
| 3374 |
dwSignerIndex: DWORD, |
| 3375 |
blob: CRYPT_DATA_BLOB, |
| 3376 |
}} |
| 3377 |
pub type PCMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA = *mut CMSG_CTRL_ADD_SIGNER_UNAUTH_ATTR_PARA; |
| 3378 |
STRUCT!{struct CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA { |
| 3379 |
cbSize: DWORD, |
| 3380 |
dwSignerIndex: DWORD, |
| 3381 |
dwUnauthAttrIndex: DWORD, |
| 3382 |
}} |
| 3383 |
pub type PCMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA = *mut CMSG_CTRL_DEL_SIGNER_UNAUTH_ATTR_PARA; |
| 3384 |
extern "system" { |
| 3385 |
pub fn CryptMsgVerifyCountersignatureEncoded( |
| 3386 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3387 |
dwEncodingType: DWORD, |
| 3388 |
pbSignerInfo: PBYTE, |
| 3389 |
cbSignerInfo: DWORD, |
| 3390 |
pbSignerInfoCountersignature: PBYTE, |
| 3391 |
cbSignerInfoCountersignature: DWORD, |
| 3392 |
pciCountersigner: PCERT_INFO, |
| 3393 |
) -> BOOL; |
| 3394 |
pub fn CryptMsgVerifyCountersignatureEncodedEx( |
| 3395 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3396 |
dwEncodingType: DWORD, |
| 3397 |
pbSignerInfo: PBYTE, |
| 3398 |
cbSignerInfo: DWORD, |
| 3399 |
pbSignerInfoCountersignature: PBYTE, |
| 3400 |
cbSignerInfoCountersignature: DWORD, |
| 3401 |
dwSignerType: DWORD, |
| 3402 |
pvSigner: *mut c_void, |
| 3403 |
dwFlags: DWORD, |
| 3404 |
pvExtra: *mut c_void, |
| 3405 |
) -> BOOL; |
| 3406 |
} |
| 3407 |
pub const CMSG_VERIFY_COUNTER_SIGN_ENABLE_STRONG_FLAG: DWORD = 0x00000001; |
| 3408 |
extern "system" { |
| 3409 |
pub fn CryptMsgCountersign( |
| 3410 |
hCryptMsg: HCRYPTMSG, |
| 3411 |
dwIndex: DWORD, |
| 3412 |
cCountersigners: DWORD, |
| 3413 |
rgCountersigners: PCMSG_SIGNER_ENCODE_INFO, |
| 3414 |
) -> BOOL; |
| 3415 |
pub fn CryptMsgCountersignEncoded( |
| 3416 |
dwEncodingType: DWORD, |
| 3417 |
pbSignerInfo: PBYTE, |
| 3418 |
cbSignerInfo: DWORD, |
| 3419 |
cCountersigners: DWORD, |
| 3420 |
rgCountersigners: PCMSG_SIGNER_ENCODE_INFO, |
| 3421 |
pbCountersignature: PBYTE, |
| 3422 |
pcbCountersignature: PDWORD, |
| 3423 |
) -> BOOL; |
| 3424 |
} |
| 3425 |
FN!{stdcall PFN_CMSG_ALLOC( |
| 3426 |
cb: size_t, |
| 3427 |
) -> ()} |
| 3428 |
FN!{stdcall PFN_CMSG_FREE( |
| 3429 |
pv: *mut c_void, |
| 3430 |
) -> ()} |
| 3431 |
pub const CMSG_OID_GEN_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllGenEncryptKey"; |
| 3432 |
FN!{stdcall PFN_CMSG_GEN_ENCRYPT_KEY( |
| 3433 |
phCryptProv: *mut HCRYPTPROV, |
| 3434 |
paiEncrypt: PCRYPT_ALGORITHM_IDENTIFIER, |
| 3435 |
pvEncryptAuxInfo: PVOID, |
| 3436 |
pPublicKeyInfo: PCERT_PUBLIC_KEY_INFO, |
| 3437 |
pfnAlloc: PFN_CMSG_ALLOC, |
| 3438 |
phEncryptKey: *mut HCRYPTKEY, |
| 3439 |
ppbEncryptParameters: *mut PBYTE, |
| 3440 |
pcbEncryptParameters: PDWORD, |
| 3441 |
) -> BOOL} |
| 3442 |
pub const CMSG_OID_EXPORT_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllExportEncryptKey"; |
| 3443 |
FN!{stdcall PFN_CMSG_EXPORT_ENCRYPT_KEY( |
| 3444 |
hCryptProv: HCRYPTPROV, |
| 3445 |
hEncryptKey: HCRYPTKEY, |
| 3446 |
pPublicKeyInfo: PCERT_PUBLIC_KEY_INFO, |
| 3447 |
pbData: PBYTE, |
| 3448 |
pcbData: PDWORD, |
| 3449 |
) -> BOOL} |
| 3450 |
pub const CMSG_OID_IMPORT_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllImportEncryptKey"; |
| 3451 |
FN!{stdcall PFN_CMSG_IMPORT_ENCRYPT_KEY( |
| 3452 |
hCryptProv: HCRYPTPROV, |
| 3453 |
dwKeySpec: DWORD, |
| 3454 |
paiEncrypt: PCRYPT_ALGORITHM_IDENTIFIER, |
| 3455 |
paiPubKey: PCRYPT_ALGORITHM_IDENTIFIER, |
| 3456 |
pbEncodedKey: PBYTE, |
| 3457 |
cbEncodedKey: DWORD, |
| 3458 |
phEncryptKey: *mut HCRYPTKEY, |
| 3459 |
) -> BOOL} |
| 3460 |
pub const CMSG_DEFAULT_INSTALLABLE_FUNC_OID: LPCSTR = 1 as LPCSTR; |
| 3461 |
UNION!{union CMSG_CONTENT_ENCRYPT_INFO_u { |
| 3462 |
[usize; 1], |
| 3463 |
hContentEncryptKey hContentEncryptKey_mut: HCRYPTKEY, |
| 3464 |
hCNGContentEncryptKey hCNGContentEncryptKey_mut: BCRYPT_KEY_HANDLE, |
| 3465 |
}} |
| 3466 |
STRUCT!{struct CMSG_CONTENT_ENCRYPT_INFO { |
| 3467 |
cbSize: DWORD, |
| 3468 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 3469 |
ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3470 |
pvEncryptionAuxInfo: *mut c_void, |
| 3471 |
cRecipients: DWORD, |
| 3472 |
rgCmsRecipients: PCMSG_RECIPIENT_ENCODE_INFO, |
| 3473 |
pfnAlloc: PFN_CMSG_ALLOC, |
| 3474 |
pfnFree: PFN_CMSG_FREE, |
| 3475 |
dwEncryptFlags: DWORD, |
| 3476 |
u: CMSG_CONTENT_ENCRYPT_INFO_u, |
| 3477 |
dwFlags: DWORD, |
| 3478 |
fCNG: BOOL, |
| 3479 |
pbCNGContentEncryptKeyObject: *mut BYTE, |
| 3480 |
pbContentEncryptKey: *mut BYTE, |
| 3481 |
cbContentEncryptKey: DWORD, |
| 3482 |
}} |
| 3483 |
pub type PCMSG_CONTENT_ENCRYPT_INFO = *mut CMSG_CONTENT_ENCRYPT_INFO; |
| 3484 |
pub const CMSG_CONTENT_ENCRYPT_PAD_ENCODED_LEN_FLAG: DWORD = 0x00000001; |
| 3485 |
pub const CMSG_CONTENT_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; |
| 3486 |
pub const CMSG_CONTENT_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000002; |
| 3487 |
pub const CMSG_CONTENT_ENCRYPT_RELEASE_CONTEXT_FLAG: DWORD = 0x00008000; |
| 3488 |
pub const CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC: &'static str = "CryptMsgDllGenContentEncryptKey"; |
| 3489 |
pub const CMSG_OID_CAPI1_GEN_CONTENT_ENCRYPT_KEY_FUNC: &'static str |
| 3490 |
= CMSG_OID_GEN_CONTENT_ENCRYPT_KEY_FUNC; |
| 3491 |
FN!{stdcall PFN_CMSG_GEN_CONTENT_ENCRYPT_KEY( |
| 3492 |
pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, |
| 3493 |
dwFlags: DWORD, |
| 3494 |
pvReserved: *mut c_void, |
| 3495 |
) -> BOOL} |
| 3496 |
pub const CMSG_OID_CNG_GEN_CONTENT_ENCRYPT_KEY_FUNC: &'static str |
| 3497 |
= "CryptMsgDllCNGGenContentEncryptKey"; |
| 3498 |
STRUCT!{struct CMSG_KEY_TRANS_ENCRYPT_INFO { |
| 3499 |
cbSize: DWORD, |
| 3500 |
dwRecipientIndex: DWORD, |
| 3501 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3502 |
EncryptedKey: CRYPT_DATA_BLOB, |
| 3503 |
dwFlags: DWORD, |
| 3504 |
}} |
| 3505 |
pub type PCMSG_KEY_TRANS_ENCRYPT_INFO = *mut CMSG_KEY_TRANS_ENCRYPT_INFO; |
| 3506 |
pub const CMSG_KEY_TRANS_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; |
| 3507 |
pub const CMSG_KEY_TRANS_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000002; |
| 3508 |
pub const CMSG_OID_EXPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllExportKeyTrans"; |
| 3509 |
pub const CMSG_OID_CAPI1_EXPORT_KEY_TRANS_FUNC: &'static str = CMSG_OID_EXPORT_KEY_TRANS_FUNC; |
| 3510 |
FN!{stdcall PFN_CMSG_EXPORT_KEY_TRANS( |
| 3511 |
pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, |
| 3512 |
pKeyTransEncodeInfo: PCMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO, |
| 3513 |
pKeyTransEncryptInfo: PCMSG_KEY_TRANS_ENCRYPT_INFO, |
| 3514 |
dwFlags: DWORD, |
| 3515 |
pvReserved: *mut c_void, |
| 3516 |
) -> BOOL} |
| 3517 |
pub const CMSG_OID_CNG_EXPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllCNGExportKeyTrans"; |
| 3518 |
STRUCT!{struct CMSG_KEY_AGREE_KEY_ENCRYPT_INFO { |
| 3519 |
cbSize: DWORD, |
| 3520 |
EncryptedKey: CRYPT_DATA_BLOB, |
| 3521 |
}} |
| 3522 |
pub type PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO = *mut CMSG_KEY_AGREE_KEY_ENCRYPT_INFO; |
| 3523 |
UNION!{union CMSG_KEY_AGREE_ENCRYPT_INFO_u { |
| 3524 |
[usize; 6], |
| 3525 |
OriginatorCertId OriginatorCertId_mut: CERT_ID, |
| 3526 |
OriginatorPublicKeyInfo OriginatorPublicKeyInfo_mut: CERT_PUBLIC_KEY_INFO, |
| 3527 |
}} |
| 3528 |
STRUCT!{struct CMSG_KEY_AGREE_ENCRYPT_INFO { |
| 3529 |
cbSize: DWORD, |
| 3530 |
dwRecipientIndex: DWORD, |
| 3531 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3532 |
UserKeyingMaterial: CRYPT_DATA_BLOB, |
| 3533 |
dwOriginatorChoice: DWORD, |
| 3534 |
u: CMSG_KEY_AGREE_ENCRYPT_INFO_u, |
| 3535 |
cKeyAgreeKeyEncryptInfo: DWORD, |
| 3536 |
rgpKeyAgreeKeyEncryptInfo: *mut PCMSG_KEY_AGREE_KEY_ENCRYPT_INFO, |
| 3537 |
dwFlags: DWORD, |
| 3538 |
}} |
| 3539 |
pub type PCMSG_KEY_AGREE_ENCRYPT_INFO = *mut CMSG_KEY_AGREE_ENCRYPT_INFO; |
| 3540 |
pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; |
| 3541 |
pub const CMSG_KEY_AGREE_ENCRYPT_FREE_MATERIAL_FLAG: DWORD = 0x00000002; |
| 3542 |
pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_ALG_FLAG: DWORD = 0x00000004; |
| 3543 |
pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_PARA_FLAG: DWORD = 0x00000008; |
| 3544 |
pub const CMSG_KEY_AGREE_ENCRYPT_FREE_PUBKEY_BITS_FLAG: DWORD = 0x00000010; |
| 3545 |
pub const CMSG_KEY_AGREE_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000020; |
| 3546 |
pub const CMSG_OID_EXPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllExportKeyAgree"; |
| 3547 |
pub const CMSG_OID_CAPI1_EXPORT_KEY_AGREE_FUNC: &'static str = CMSG_OID_EXPORT_KEY_AGREE_FUNC; |
| 3548 |
FN!{stdcall PFN_CMSG_EXPORT_KEY_AGREE( |
| 3549 |
pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, |
| 3550 |
pKeyAgreeEncodeInfo: PCMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO, |
| 3551 |
pKeyAgreeEncryptInfo: PCMSG_KEY_AGREE_ENCRYPT_INFO, |
| 3552 |
dwFlags: DWORD, |
| 3553 |
pvReserved: *mut c_void, |
| 3554 |
) -> BOOL} |
| 3555 |
pub const CMSG_OID_CNG_EXPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllCNGExportKeyAgree"; |
| 3556 |
STRUCT!{struct CMSG_MAIL_LIST_ENCRYPT_INFO { |
| 3557 |
cbSize: DWORD, |
| 3558 |
dwRecipientIndex: DWORD, |
| 3559 |
KeyEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3560 |
EncryptedKey: CRYPT_DATA_BLOB, |
| 3561 |
dwFlags: DWORD, |
| 3562 |
}} |
| 3563 |
pub type PCMSG_MAIL_LIST_ENCRYPT_INFO = *mut CMSG_MAIL_LIST_ENCRYPT_INFO; |
| 3564 |
pub const CMSG_MAIL_LIST_ENCRYPT_FREE_PARA_FLAG: DWORD = 0x00000001; |
| 3565 |
pub const CMSG_MAIL_LIST_ENCRYPT_FREE_OBJID_FLAG: DWORD = 0x00000002; |
| 3566 |
pub const CMSG_OID_EXPORT_MAIL_LIST_FUNC: &'static str = "CryptMsgDllExportMailList"; |
| 3567 |
pub const CMSG_OID_CAPI1_EXPORT_MAIL_LIST_FUNC: &'static str = CMSG_OID_EXPORT_MAIL_LIST_FUNC; |
| 3568 |
FN!{stdcall PFN_CMSG_EXPORT_MAIL_LIST( |
| 3569 |
pContentEncryptInfo: PCMSG_CONTENT_ENCRYPT_INFO, |
| 3570 |
pMailListEncodeInfo: PCMSG_MAIL_LIST_RECIPIENT_ENCODE_INFO, |
| 3571 |
pMailListEncryptInfo: PCMSG_MAIL_LIST_ENCRYPT_INFO, |
| 3572 |
dwFlags: DWORD, |
| 3573 |
pvReserved: *mut c_void, |
| 3574 |
) -> BOOL} |
| 3575 |
pub const CMSG_OID_IMPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllImportKeyTrans"; |
| 3576 |
pub const CMSG_OID_CAPI1_IMPORT_KEY_TRANS_FUNC: &'static str = CMSG_OID_IMPORT_KEY_TRANS_FUNC; |
| 3577 |
FN!{stdcall PFN_CMSG_IMPORT_KEY_TRANS( |
| 3578 |
pContentEncryptionAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 3579 |
pKeyTransDecryptPara: PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA, |
| 3580 |
dwFlags: DWORD, |
| 3581 |
pvReserved: *mut c_void, |
| 3582 |
phContentEncryptKey: *mut HCRYPTKEY, |
| 3583 |
) -> BOOL} |
| 3584 |
pub const CMSG_OID_IMPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllImportKeyAgree"; |
| 3585 |
pub const CMSG_OID_CAPI1_IMPORT_KEY_AGREE_FUNC: &'static str = CMSG_OID_IMPORT_KEY_AGREE_FUNC; |
| 3586 |
FN!{stdcall PFN_CMSG_IMPORT_KEY_AGREE( |
| 3587 |
pContentEncryptionAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 3588 |
pKeyAgreeDecryptPara: PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA, |
| 3589 |
dwFlags: DWORD, |
| 3590 |
pvReserved: *mut c_void, |
| 3591 |
phContentEncryptKey: *mut HCRYPTKEY, |
| 3592 |
) -> BOOL} |
| 3593 |
pub const CMSG_OID_IMPORT_MAIL_LIST_FUNC: &'static str = "CryptMsgDllImportMailList"; |
| 3594 |
pub const CMSG_OID_CAPI1_IMPORT_MAIL_LIST_FUNC: &'static str = CMSG_OID_IMPORT_MAIL_LIST_FUNC; |
| 3595 |
FN!{stdcall PFN_CMSG_IMPORT_MAIL_LIST( |
| 3596 |
pContentEncryptionAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 3597 |
pMailListDecryptPara: PCMSG_CTRL_MAIL_LIST_DECRYPT_PARA, |
| 3598 |
dwFlags: DWORD, |
| 3599 |
pvReserved: *mut c_void, |
| 3600 |
phContentEncryptKey: *mut HCRYPTKEY, |
| 3601 |
) -> BOOL} |
| 3602 |
STRUCT!{struct CMSG_CNG_CONTENT_DECRYPT_INFO { |
| 3603 |
cbSize: DWORD, |
| 3604 |
ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 3605 |
pfnAlloc: PFN_CMSG_ALLOC, |
| 3606 |
pfnFree: PFN_CMSG_FREE, |
| 3607 |
hNCryptKey: NCRYPT_KEY_HANDLE, |
| 3608 |
pbContentEncryptKey: *mut BYTE, |
| 3609 |
cbContentEncryptKey: DWORD, |
| 3610 |
hCNGContentEncryptKey: BCRYPT_KEY_HANDLE, |
| 3611 |
pbCNGContentEncryptKeyObject: *mut BYTE, |
| 3612 |
}} |
| 3613 |
pub type PCMSG_CNG_CONTENT_DECRYPT_INFO = *mut CMSG_CNG_CONTENT_DECRYPT_INFO; |
| 3614 |
pub const CMSG_OID_CNG_IMPORT_KEY_TRANS_FUNC: &'static str = "CryptMsgDllCNGImportKeyTrans"; |
| 3615 |
FN!{stdcall PFN_CMSG_CNG_IMPORT_KEY_TRANS( |
| 3616 |
pCNGContentDecryptInfo: PCMSG_CNG_CONTENT_DECRYPT_INFO, |
| 3617 |
pKeyTransDecryptPara: PCMSG_CTRL_KEY_TRANS_DECRYPT_PARA, |
| 3618 |
dwFlags: DWORD, |
| 3619 |
pvReserved: *mut c_void, |
| 3620 |
) -> BOOL} |
| 3621 |
pub const CMSG_OID_CNG_IMPORT_KEY_AGREE_FUNC: &'static str = "CryptMsgDllCNGImportKeyAgree"; |
| 3622 |
FN!{stdcall PFN_CMSG_CNG_IMPORT_KEY_AGREE( |
| 3623 |
pCNGContentDecryptInfo: PCMSG_CNG_CONTENT_DECRYPT_INFO, |
| 3624 |
pKeyAgreeDecryptPara: PCMSG_CTRL_KEY_AGREE_DECRYPT_PARA, |
| 3625 |
dwFlags: DWORD, |
| 3626 |
pvReserved: *mut c_void, |
| 3627 |
) -> BOOL} |
| 3628 |
pub const CMSG_OID_CNG_IMPORT_CONTENT_ENCRYPT_KEY_FUNC: &'static str |
| 3629 |
= "CryptMsgDllCNGImportContentEncryptKey"; |
| 3630 |
FN!{stdcall PFN_CMSG_CNG_IMPORT_CONTENT_ENCRYPT_KEY( |
| 3631 |
pCNGContentDecryptInfo: PCMSG_CNG_CONTENT_DECRYPT_INFO, |
| 3632 |
dwFlags: DWORD, |
| 3633 |
pvReserved: *mut c_void, |
| 3634 |
) -> BOOL} |
| 3635 |
pub type HCERTSTORE = *mut c_void; |
| 3636 |
STRUCT!{struct CERT_CONTEXT { |
| 3637 |
dwCertEncodingType: DWORD, |
| 3638 |
pbCertEncoded: *mut BYTE, |
| 3639 |
cbCertEncoded: DWORD, |
| 3640 |
pCertInfo: PCERT_INFO, |
| 3641 |
hCertStore: HCERTSTORE, |
| 3642 |
}} |
| 3643 |
pub type PCERT_CONTEXT = *mut CERT_CONTEXT; |
| 3644 |
pub type PCCERT_CONTEXT = *const CERT_CONTEXT; |
| 3645 |
STRUCT!{struct CRL_CONTEXT { |
| 3646 |
dwCertEncodingType: DWORD, |
| 3647 |
pbCrlEncoded: *mut BYTE, |
| 3648 |
cbCrlEncoded: DWORD, |
| 3649 |
pCrlInfo: PCRL_INFO, |
| 3650 |
hCertStore: HCERTSTORE, |
| 3651 |
}} |
| 3652 |
pub type PCRL_CONTEXT = *mut CRL_CONTEXT; |
| 3653 |
pub type PCCRL_CONTEXT = *const CRL_CONTEXT; |
| 3654 |
STRUCT!{struct CTL_CONTEXT { |
| 3655 |
dwMsgAndCertEncodingType: DWORD, |
| 3656 |
pbCtlEncoded: *mut BYTE, |
| 3657 |
cbCtlEncoded: DWORD, |
| 3658 |
pCtlInfo: PCTL_INFO, |
| 3659 |
hCertStore: HCERTSTORE, |
| 3660 |
hCryptMsg: HCRYPTMSG, |
| 3661 |
pbCtlContent: *mut BYTE, |
| 3662 |
cbCtlContent: DWORD, |
| 3663 |
}} |
| 3664 |
pub type PCTL_CONTEXT = *mut CTL_CONTEXT; |
| 3665 |
pub type PCCTL_CONTEXT = *const CTL_CONTEXT; |
| 3666 |
pub const CERT_KEY_PROV_HANDLE_PROP_ID: DWORD = 1; |
| 3667 |
pub const CERT_KEY_PROV_INFO_PROP_ID: DWORD = 2; |
| 3668 |
pub const CERT_SHA1_HASH_PROP_ID: DWORD = 3; |
| 3669 |
pub const CERT_MD5_HASH_PROP_ID: DWORD = 4; |
| 3670 |
pub const CERT_HASH_PROP_ID: DWORD = CERT_SHA1_HASH_PROP_ID; |
| 3671 |
pub const CERT_KEY_CONTEXT_PROP_ID: DWORD = 5; |
| 3672 |
pub const CERT_KEY_SPEC_PROP_ID: DWORD = 6; |
| 3673 |
pub const CERT_IE30_RESERVED_PROP_ID: DWORD = 7; |
| 3674 |
pub const CERT_PUBKEY_HASH_RESERVED_PROP_ID: DWORD = 8; |
| 3675 |
pub const CERT_ENHKEY_USAGE_PROP_ID: DWORD = 9; |
| 3676 |
pub const CERT_CTL_USAGE_PROP_ID: DWORD = CERT_ENHKEY_USAGE_PROP_ID; |
| 3677 |
pub const CERT_NEXT_UPDATE_LOCATION_PROP_ID: DWORD = 10; |
| 3678 |
pub const CERT_FRIENDLY_NAME_PROP_ID: DWORD = 11; |
| 3679 |
pub const CERT_PVK_FILE_PROP_ID: DWORD = 12; |
| 3680 |
pub const CERT_DESCRIPTION_PROP_ID: DWORD = 13; |
| 3681 |
pub const CERT_ACCESS_STATE_PROP_ID: DWORD = 14; |
| 3682 |
pub const CERT_SIGNATURE_HASH_PROP_ID: DWORD = 15; |
| 3683 |
pub const CERT_SMART_CARD_DATA_PROP_ID: DWORD = 16; |
| 3684 |
pub const CERT_EFS_PROP_ID: DWORD = 17; |
| 3685 |
pub const CERT_FORTEZZA_DATA_PROP_ID: DWORD = 18; |
| 3686 |
pub const CERT_ARCHIVED_PROP_ID: DWORD = 19; |
| 3687 |
pub const CERT_KEY_IDENTIFIER_PROP_ID: DWORD = 20; |
| 3688 |
pub const CERT_AUTO_ENROLL_PROP_ID: DWORD = 21; |
| 3689 |
pub const CERT_PUBKEY_ALG_PARA_PROP_ID: DWORD = 22; |
| 3690 |
pub const CERT_CROSS_CERT_DIST_POINTS_PROP_ID: DWORD = 23; |
| 3691 |
pub const CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID: DWORD = 24; |
| 3692 |
pub const CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: DWORD = 25; |
| 3693 |
pub const CERT_ENROLLMENT_PROP_ID: DWORD = 26; |
| 3694 |
pub const CERT_DATE_STAMP_PROP_ID: DWORD = 27; |
| 3695 |
pub const CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: DWORD = 28; |
| 3696 |
pub const CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: DWORD = 29; |
| 3697 |
pub const CERT_EXTENDED_ERROR_INFO_PROP_ID: DWORD = 30; |
| 3698 |
pub const CERT_RENEWAL_PROP_ID: DWORD = 64; |
| 3699 |
pub const CERT_ARCHIVED_KEY_HASH_PROP_ID: DWORD = 65; |
| 3700 |
pub const CERT_AUTO_ENROLL_RETRY_PROP_ID: DWORD = 66; |
| 3701 |
pub const CERT_AIA_URL_RETRIEVED_PROP_ID: DWORD = 67; |
| 3702 |
pub const CERT_AUTHORITY_INFO_ACCESS_PROP_ID: DWORD = 68; |
| 3703 |
pub const CERT_BACKED_UP_PROP_ID: DWORD = 69; |
| 3704 |
pub const CERT_OCSP_RESPONSE_PROP_ID: DWORD = 70; |
| 3705 |
pub const CERT_REQUEST_ORIGINATOR_PROP_ID: DWORD = 71; |
| 3706 |
pub const CERT_SOURCE_LOCATION_PROP_ID: DWORD = 72; |
| 3707 |
pub const CERT_SOURCE_URL_PROP_ID: DWORD = 73; |
| 3708 |
pub const CERT_NEW_KEY_PROP_ID: DWORD = 74; |
| 3709 |
pub const CERT_OCSP_CACHE_PREFIX_PROP_ID: DWORD = 75; |
| 3710 |
pub const CERT_SMART_CARD_ROOT_INFO_PROP_ID: DWORD = 76; |
| 3711 |
pub const CERT_NO_AUTO_EXPIRE_CHECK_PROP_ID: DWORD = 77; |
| 3712 |
pub const CERT_NCRYPT_KEY_HANDLE_PROP_ID: DWORD = 78; |
| 3713 |
pub const CERT_HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_PROP_ID: DWORD = 79; |
| 3714 |
pub const CERT_SUBJECT_INFO_ACCESS_PROP_ID: DWORD = 80; |
| 3715 |
pub const CERT_CA_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID: DWORD = 81; |
| 3716 |
pub const CERT_CA_DISABLE_CRL_PROP_ID: DWORD = 82; |
| 3717 |
pub const CERT_ROOT_PROGRAM_CERT_POLICIES_PROP_ID: DWORD = 83; |
| 3718 |
pub const CERT_ROOT_PROGRAM_NAME_CONSTRAINTS_PROP_ID: DWORD = 84; |
| 3719 |
pub const CERT_SUBJECT_OCSP_AUTHORITY_INFO_ACCESS_PROP_ID: DWORD = 85; |
| 3720 |
pub const CERT_SUBJECT_DISABLE_CRL_PROP_ID: DWORD = 86; |
| 3721 |
pub const CERT_CEP_PROP_ID: DWORD = 87; |
| 3722 |
pub const CERT_SIGN_HASH_CNG_ALG_PROP_ID: DWORD = 89; |
| 3723 |
pub const CERT_SCARD_PIN_ID_PROP_ID: DWORD = 90; |
| 3724 |
pub const CERT_SCARD_PIN_INFO_PROP_ID: DWORD = 91; |
| 3725 |
pub const CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID: DWORD = 92; |
| 3726 |
pub const CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID: DWORD = 93; |
| 3727 |
pub const CERT_ISSUER_PUB_KEY_BIT_LENGTH_PROP_ID: DWORD = 94; |
| 3728 |
pub const CERT_ISSUER_CHAIN_SIGN_HASH_CNG_ALG_PROP_ID: DWORD = 95; |
| 3729 |
pub const CERT_ISSUER_CHAIN_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID: DWORD = 96; |
| 3730 |
pub const CERT_NO_EXPIRE_NOTIFICATION_PROP_ID: DWORD = 97; |
| 3731 |
pub const CERT_AUTH_ROOT_SHA256_HASH_PROP_ID: DWORD = 98; |
| 3732 |
pub const CERT_NCRYPT_KEY_HANDLE_TRANSFER_PROP_ID: DWORD = 99; |
| 3733 |
pub const CERT_HCRYPTPROV_TRANSFER_PROP_ID: DWORD = 100; |
| 3734 |
pub const CERT_SMART_CARD_READER_PROP_ID: DWORD = 101; |
| 3735 |
pub const CERT_SEND_AS_TRUSTED_ISSUER_PROP_ID: DWORD = 102; |
| 3736 |
pub const CERT_KEY_REPAIR_ATTEMPTED_PROP_ID: DWORD = 103; |
| 3737 |
pub const CERT_DISALLOWED_FILETIME_PROP_ID: DWORD = 104; |
| 3738 |
pub const CERT_ROOT_PROGRAM_CHAIN_POLICIES_PROP_ID: DWORD = 105; |
| 3739 |
pub const CERT_SMART_CARD_READER_NON_REMOVABLE_PROP_ID: DWORD = 106; |
| 3740 |
pub const CERT_SHA256_HASH_PROP_ID: DWORD = 107; |
| 3741 |
pub const CERT_SCEP_SERVER_CERTS_PROP_ID: DWORD = 108; |
| 3742 |
pub const CERT_SCEP_RA_SIGNATURE_CERT_PROP_ID: DWORD = 109; |
| 3743 |
pub const CERT_SCEP_RA_ENCRYPTION_CERT_PROP_ID: DWORD = 110; |
| 3744 |
pub const CERT_SCEP_CA_CERT_PROP_ID: DWORD = 111; |
| 3745 |
pub const CERT_SCEP_SIGNER_CERT_PROP_ID: DWORD = 112; |
| 3746 |
pub const CERT_SCEP_NONCE_PROP_ID: DWORD = 113; |
| 3747 |
pub const CERT_SCEP_ENCRYPT_HASH_CNG_ALG_PROP_ID: DWORD = 114; |
| 3748 |
pub const CERT_SCEP_FLAGS_PROP_ID: DWORD = 115; |
| 3749 |
pub const CERT_SCEP_GUID_PROP_ID: DWORD = 116; |
| 3750 |
pub const CERT_SERIALIZABLE_KEY_CONTEXT_PROP_ID: DWORD = 117; |
| 3751 |
pub const CERT_ISOLATED_KEY_PROP_ID: DWORD = 118; |
| 3752 |
pub const CERT_SERIAL_CHAIN_PROP_ID: DWORD = 119; |
| 3753 |
pub const CERT_KEY_CLASSIFICATION_PROP_ID: DWORD = 120; |
| 3754 |
pub const CERT_OCSP_MUST_STAPLE_PROP_ID: DWORD = 121; |
| 3755 |
pub const CERT_DISALLOWED_ENHKEY_USAGE_PROP_ID: DWORD = 122; |
| 3756 |
pub const CERT_NONCOMPLIANT_ROOT_URL_PROP_ID: DWORD = 123; |
| 3757 |
pub const CERT_PIN_SHA256_HASH_PROP_ID: DWORD = 124; |
| 3758 |
pub const CERT_CLR_DELETE_KEY_PROP_ID: DWORD = 125; |
| 3759 |
pub const CERT_NOT_BEFORE_FILETIME_PROP_ID: DWORD = 126; |
| 3760 |
pub const CERT_NOT_BEFORE_ENHKEY_USAGE_PROP_ID: DWORD = 127; |
| 3761 |
pub const CERT_FIRST_RESERVED_PROP_ID: DWORD = 128; |
| 3762 |
pub const CERT_LAST_RESERVED_PROP_ID: DWORD = 0x00007FFF; |
| 3763 |
pub const CERT_FIRST_USER_PROP_ID: DWORD = 0x00008000; |
| 3764 |
pub const CERT_LAST_USER_PROP_ID: DWORD = 0x0000FFFF; |
| 3765 |
ENUM!{enum CertKeyType { |
| 3766 |
KeyTypeOther = 0, |
| 3767 |
KeyTypeVirtualSmartCard = 1, |
| 3768 |
KeyTypePhysicalSmartCard = 2, |
| 3769 |
KeyTypePassport = 3, |
| 3770 |
KeyTypePassportRemote = 4, |
| 3771 |
KeyTypePassportSmartCard = 5, |
| 3772 |
KeyTypeHardware = 6, |
| 3773 |
KeyTypeSoftware = 7, |
| 3774 |
KeyTypeSelfSigned = 8, |
| 3775 |
}} |
| 3776 |
#[inline] |
| 3777 |
pub fn IS_CERT_HASH_PROP_ID(X: DWORD) -> bool { |
| 3778 |
CERT_SHA1_HASH_PROP_ID == X || CERT_MD5_HASH_PROP_ID == X || CERT_SHA256_HASH_PROP_ID == X |
| 3779 |
|| CERT_SIGNATURE_HASH_PROP_ID == X |
| 3780 |
} |
| 3781 |
#[inline] |
| 3782 |
pub fn IS_PUBKEY_HASH_PROP_ID(X: DWORD) -> bool { |
| 3783 |
CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID == X || CERT_PIN_SHA256_HASH_PROP_ID == X |
| 3784 |
|| CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == X |
| 3785 |
} |
| 3786 |
#[inline] |
| 3787 |
pub fn IS_CHAIN_HASH_PROP_ID(X: DWORD) -> bool { |
| 3788 |
CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID == X || CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID == X |
| 3789 |
|| CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID == X || CERT_SUBJECT_NAME_MD5_HASH_PROP_ID == X |
| 3790 |
} |
| 3791 |
#[inline] |
| 3792 |
pub fn IS_STRONG_SIGN_PROP_ID(X: DWORD) -> bool { |
| 3793 |
CERT_SIGN_HASH_CNG_ALG_PROP_ID == X || CERT_SUBJECT_PUB_KEY_BIT_LENGTH_PROP_ID == X |
| 3794 |
|| CERT_PUB_KEY_CNG_ALG_BIT_LENGTH_PROP_ID == X |
| 3795 |
} |
| 3796 |
pub const szOID_CERT_PROP_ID_PREFIX: &'static str = "1.3.6.1.4.1.311.10.11."; |
| 3797 |
pub const szOID_CERT_KEY_IDENTIFIER_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.20"; |
| 3798 |
pub const szOID_CERT_ISSUER_SERIAL_NUMBER_MD5_HASH_PROP_ID: &'static str |
| 3799 |
= "1.3.6.1.4.1.311.10.11.28"; |
| 3800 |
pub const szOID_CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.29"; |
| 3801 |
pub const szOID_CERT_MD5_HASH_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.4"; |
| 3802 |
pub const szOID_CERT_SIGNATURE_HASH_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.15"; |
| 3803 |
pub const szOID_DISALLOWED_HASH: &'static str = szOID_CERT_SIGNATURE_HASH_PROP_ID; |
| 3804 |
pub const szOID_CERT_DISALLOWED_FILETIME_PROP_ID: &'static str = "1.3.6.1.4.1.311.10.11.104"; |
| 3805 |
pub const CERT_ACCESS_STATE_WRITE_PERSIST_FLAG: DWORD = 0x1; |
| 3806 |
pub const CERT_ACCESS_STATE_SYSTEM_STORE_FLAG: DWORD = 0x2; |
| 3807 |
pub const CERT_ACCESS_STATE_LM_SYSTEM_STORE_FLAG: DWORD = 0x4; |
| 3808 |
pub const CERT_ACCESS_STATE_GP_SYSTEM_STORE_FLAG: DWORD = 0x8; |
| 3809 |
pub const CERT_ACCESS_STATE_SHARED_USER_FLAG: DWORD = 0x10; |
| 3810 |
pub const szOID_ROOT_PROGRAM_AUTO_UPDATE_CA_REVOCATION: &'static str = "1.3.6.1.4.1.311.60.3.1"; |
| 3811 |
pub const szOID_ROOT_PROGRAM_AUTO_UPDATE_END_REVOCATION: &'static str = "1.3.6.1.4.1.311.60.3.2"; |
| 3812 |
pub const szOID_ROOT_PROGRAM_NO_OCSP_FAILOVER_TO_CRL: &'static str = "1.3.6.1.4.1.311.60.3.3"; |
| 3813 |
STRUCT!{struct CRYPT_KEY_PROV_PARAM { |
| 3814 |
dwParam: DWORD, |
| 3815 |
pbData: *mut BYTE, |
| 3816 |
cbData: DWORD, |
| 3817 |
dwFlags: DWORD, |
| 3818 |
}} |
| 3819 |
pub type PCRYPT_KEY_PROV_PARAM = *mut CRYPT_KEY_PROV_PARAM; |
| 3820 |
STRUCT!{struct CRYPT_KEY_PROV_INFO { |
| 3821 |
pwszContainerName: LPWSTR, |
| 3822 |
pwszProvName: LPWSTR, |
| 3823 |
dwProvType: DWORD, |
| 3824 |
dwFlags: DWORD, |
| 3825 |
cProvParam: DWORD, |
| 3826 |
rgProvParam: PCRYPT_KEY_PROV_PARAM, |
| 3827 |
dwKeySpec: DWORD, |
| 3828 |
}} |
| 3829 |
pub type PCRYPT_KEY_PROV_INFO = *mut CRYPT_KEY_PROV_INFO; |
| 3830 |
pub const CERT_SET_KEY_PROV_HANDLE_PROP_ID: DWORD = 0x00000001; |
| 3831 |
pub const CERT_SET_KEY_CONTEXT_PROP_ID: DWORD = 0x00000001; |
| 3832 |
pub const CERT_NCRYPT_KEY_SPEC: DWORD = 0xFFFFFFFF; |
| 3833 |
UNION!{union CERT_KEY_CONTEXT_u { |
| 3834 |
[usize; 1], |
| 3835 |
hCryptProv hCryptProv_mut: HCRYPTPROV, |
| 3836 |
hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, |
| 3837 |
}} |
| 3838 |
STRUCT!{struct CERT_KEY_CONTEXT { |
| 3839 |
cbSize: DWORD, |
| 3840 |
u: CERT_KEY_CONTEXT_u, |
| 3841 |
dwKeySpec: DWORD, |
| 3842 |
}} |
| 3843 |
pub type PCERT_KEY_CONTEXT = *mut CERT_KEY_CONTEXT; |
| 3844 |
STRUCT!{struct ROOT_INFO_LUID { |
| 3845 |
LowPart: DWORD, |
| 3846 |
HighPart: LONG, |
| 3847 |
}} |
| 3848 |
pub type PROOT_INFO_LUID = *mut ROOT_INFO_LUID; |
| 3849 |
STRUCT!{struct CRYPT_SMART_CARD_ROOT_INFO { |
| 3850 |
rgbCardID: [BYTE; 16], |
| 3851 |
luid: ROOT_INFO_LUID, |
| 3852 |
}} |
| 3853 |
pub type PCRYPT_SMART_CARD_ROOT_INFO = *mut CRYPT_SMART_CARD_ROOT_INFO; |
| 3854 |
pub const CERT_STORE_PROV_MSG: LPCSTR = 1 as LPCSTR; |
| 3855 |
pub const CERT_STORE_PROV_MEMORY: LPCSTR = 2 as LPCSTR; |
| 3856 |
pub const CERT_STORE_PROV_FILE: LPCSTR = 3 as LPCSTR; |
| 3857 |
pub const CERT_STORE_PROV_REG: LPCSTR = 4 as LPCSTR; |
| 3858 |
pub const CERT_STORE_PROV_PKCS7: LPCSTR = 5 as LPCSTR; |
| 3859 |
pub const CERT_STORE_PROV_SERIALIZED: LPCSTR = 6 as LPCSTR; |
| 3860 |
pub const CERT_STORE_PROV_FILENAME_A: LPCSTR = 7 as LPCSTR; |
| 3861 |
pub const CERT_STORE_PROV_FILENAME_W: LPCSTR = 8 as LPCSTR; |
| 3862 |
pub const CERT_STORE_PROV_FILENAME: LPCSTR = CERT_STORE_PROV_FILENAME_W; |
| 3863 |
pub const CERT_STORE_PROV_SYSTEM_A: LPCSTR = 9 as LPCSTR; |
| 3864 |
pub const CERT_STORE_PROV_SYSTEM_W: LPCSTR = 10 as LPCSTR; |
| 3865 |
pub const CERT_STORE_PROV_SYSTEM: LPCSTR = CERT_STORE_PROV_SYSTEM_W; |
| 3866 |
pub const CERT_STORE_PROV_COLLECTION: LPCSTR = 11 as LPCSTR; |
| 3867 |
pub const CERT_STORE_PROV_SYSTEM_REGISTRY_A: LPCSTR = 12 as LPCSTR; |
| 3868 |
pub const CERT_STORE_PROV_SYSTEM_REGISTRY_W: LPCSTR = 13 as LPCSTR; |
| 3869 |
pub const CERT_STORE_PROV_SYSTEM_REGISTRY: LPCSTR = CERT_STORE_PROV_SYSTEM_REGISTRY_W; |
| 3870 |
pub const CERT_STORE_PROV_PHYSICAL_W: LPCSTR = 14 as LPCSTR; |
| 3871 |
pub const CERT_STORE_PROV_PHYSICAL: LPCSTR = CERT_STORE_PROV_PHYSICAL_W; |
| 3872 |
pub const CERT_STORE_PROV_SMART_CARD_W: LPCSTR = 15 as LPCSTR; |
| 3873 |
pub const CERT_STORE_PROV_SMART_CARD: LPCSTR = CERT_STORE_PROV_SMART_CARD_W; |
| 3874 |
pub const CERT_STORE_PROV_LDAP_W: LPCSTR = 16 as LPCSTR; |
| 3875 |
pub const CERT_STORE_PROV_LDAP: LPCSTR = CERT_STORE_PROV_LDAP_W; |
| 3876 |
pub const CERT_STORE_PROV_PKCS12: LPCSTR = 17 as LPCSTR; |
| 3877 |
pub const sz_CERT_STORE_PROV_MEMORY: &'static str = "Memory"; |
| 3878 |
pub const sz_CERT_STORE_PROV_FILENAME_W: &'static str = "File"; |
| 3879 |
pub const sz_CERT_STORE_PROV_FILENAME: &'static str = sz_CERT_STORE_PROV_FILENAME_W; |
| 3880 |
pub const sz_CERT_STORE_PROV_SYSTEM_W: &'static str = "System"; |
| 3881 |
pub const sz_CERT_STORE_PROV_SYSTEM: &'static str = sz_CERT_STORE_PROV_SYSTEM_W; |
| 3882 |
pub const sz_CERT_STORE_PROV_PKCS7: &'static str = "PKCS7"; |
| 3883 |
pub const sz_CERT_STORE_PROV_PKCS12: &'static str = "PKCS12"; |
| 3884 |
pub const sz_CERT_STORE_PROV_SERIALIZED: &'static str = "Serialized"; |
| 3885 |
pub const sz_CERT_STORE_PROV_COLLECTION: &'static str = "Collection"; |
| 3886 |
pub const sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W: &'static str = "SystemRegistry"; |
| 3887 |
pub const sz_CERT_STORE_PROV_SYSTEM_REGISTRY: &'static str = sz_CERT_STORE_PROV_SYSTEM_REGISTRY_W; |
| 3888 |
pub const sz_CERT_STORE_PROV_PHYSICAL_W: &'static str = "Physical"; |
| 3889 |
pub const sz_CERT_STORE_PROV_PHYSICAL: &'static str = sz_CERT_STORE_PROV_PHYSICAL_W; |
| 3890 |
pub const sz_CERT_STORE_PROV_SMART_CARD_W: &'static str = "SmartCard"; |
| 3891 |
pub const sz_CERT_STORE_PROV_SMART_CARD: &'static str = sz_CERT_STORE_PROV_SMART_CARD_W; |
| 3892 |
pub const sz_CERT_STORE_PROV_LDAP_W: &'static str = "Ldap"; |
| 3893 |
pub const sz_CERT_STORE_PROV_LDAP: &'static str = sz_CERT_STORE_PROV_LDAP_W; |
| 3894 |
pub const CERT_STORE_SIGNATURE_FLAG: DWORD = 0x00000001; |
| 3895 |
pub const CERT_STORE_TIME_VALIDITY_FLAG: DWORD = 0x00000002; |
| 3896 |
pub const CERT_STORE_REVOCATION_FLAG: DWORD = 0x00000004; |
| 3897 |
pub const CERT_STORE_NO_CRL_FLAG: DWORD = 0x00010000; |
| 3898 |
pub const CERT_STORE_NO_ISSUER_FLAG: DWORD = 0x00020000; |
| 3899 |
pub const CERT_STORE_BASE_CRL_FLAG: DWORD = 0x00000100; |
| 3900 |
pub const CERT_STORE_DELTA_CRL_FLAG: DWORD = 0x00000200; |
| 3901 |
pub const CERT_STORE_NO_CRYPT_RELEASE_FLAG: DWORD = 0x00000001; |
| 3902 |
pub const CERT_STORE_SET_LOCALIZED_NAME_FLAG: DWORD = 0x00000002; |
| 3903 |
pub const CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG: DWORD = 0x00000004; |
| 3904 |
pub const CERT_STORE_DELETE_FLAG: DWORD = 0x00000010; |
| 3905 |
pub const CERT_STORE_SHARE_STORE_FLAG: DWORD = 0x00000040; |
| 3906 |
pub const CERT_STORE_SHARE_CONTEXT_FLAG: DWORD = 0x00000080; |
| 3907 |
pub const CERT_STORE_MANIFOLD_FLAG: DWORD = 0x00000100; |
| 3908 |
pub const CERT_STORE_ENUM_ARCHIVED_FLAG: DWORD = 0x00000200; |
| 3909 |
pub const CERT_STORE_UPDATE_KEYID_FLAG: DWORD = 0x00000400; |
| 3910 |
pub const CERT_STORE_BACKUP_RESTORE_FLAG: DWORD = 0x00000800; |
| 3911 |
pub const CERT_STORE_READONLY_FLAG: DWORD = 0x00008000; |
| 3912 |
pub const CERT_STORE_OPEN_EXISTING_FLAG: DWORD = 0x00004000; |
| 3913 |
pub const CERT_STORE_CREATE_NEW_FLAG: DWORD = 0x00002000; |
| 3914 |
pub const CERT_STORE_MAXIMUM_ALLOWED_FLAG: DWORD = 0x00001000; |
| 3915 |
pub const CERT_SYSTEM_STORE_MASK: DWORD = 0xFFFF0000; |
| 3916 |
pub const CERT_SYSTEM_STORE_RELOCATE_FLAG: DWORD = 0x80000000; |
| 3917 |
UNION!{union CERT_SYSTEM_STORE_RELOCATE_PARA_u1 { |
| 3918 |
[usize; 1], |
| 3919 |
hKeyBase hKeyBase_mut: HKEY, |
| 3920 |
pvBase pvBase_mut: *mut c_void, |
| 3921 |
}} |
| 3922 |
UNION!{union CERT_SYSTEM_STORE_RELOCATE_PARA_u2 { |
| 3923 |
[usize; 1], |
| 3924 |
pvSystemStore pvSystemStore__mut: *mut c_void, |
| 3925 |
pszSystemStore pszSystemStore_mut: LPCSTR, |
| 3926 |
pwszSystemStore pwszSystemStore_mut: LPCWSTR, |
| 3927 |
}} |
| 3928 |
STRUCT!{struct CERT_SYSTEM_STORE_RELOCATE_PARA { |
| 3929 |
u1: CERT_SYSTEM_STORE_RELOCATE_PARA_u1, |
| 3930 |
u2: CERT_SYSTEM_STORE_RELOCATE_PARA_u2, |
| 3931 |
}} |
| 3932 |
pub type PCERT_SYSTEM_STORE_RELOCATE_PARA = *mut CERT_SYSTEM_STORE_RELOCATE_PARA; |
| 3933 |
pub const CERT_SYSTEM_STORE_UNPROTECTED_FLAG: DWORD = 0x40000000; |
| 3934 |
pub const CERT_SYSTEM_STORE_LOCATION_MASK: DWORD = 0x00FF0000; |
| 3935 |
pub const CERT_SYSTEM_STORE_LOCATION_SHIFT: DWORD = 16; |
| 3936 |
pub const CERT_SYSTEM_STORE_CURRENT_USER_ID: DWORD = 1; |
| 3937 |
pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_ID: DWORD = 2; |
| 3938 |
pub const CERT_SYSTEM_STORE_CURRENT_SERVICE_ID: DWORD = 4; |
| 3939 |
pub const CERT_SYSTEM_STORE_SERVICES_ID: DWORD = 5; |
| 3940 |
pub const CERT_SYSTEM_STORE_USERS_ID: DWORD = 6; |
| 3941 |
pub const CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID: DWORD = 7; |
| 3942 |
pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID: DWORD = 8; |
| 3943 |
pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID: DWORD = 9; |
| 3944 |
pub const CERT_SYSTEM_STORE_CURRENT_USER: DWORD = CERT_SYSTEM_STORE_CURRENT_USER_ID |
| 3945 |
<< CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3946 |
pub const CERT_SYSTEM_STORE_LOCAL_MACHINE: DWORD = CERT_SYSTEM_STORE_LOCAL_MACHINE_ID |
| 3947 |
<< CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3948 |
pub const CERT_SYSTEM_STORE_CURRENT_SERVICE: DWORD = CERT_SYSTEM_STORE_CURRENT_SERVICE_ID |
| 3949 |
<< CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3950 |
pub const CERT_SYSTEM_STORE_SERVICES: DWORD = CERT_SYSTEM_STORE_SERVICES_ID |
| 3951 |
<< CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3952 |
pub const CERT_SYSTEM_STORE_USERS: DWORD = CERT_SYSTEM_STORE_USERS_ID |
| 3953 |
<< CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3954 |
pub const CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY: DWORD |
| 3955 |
= CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3956 |
pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY: DWORD |
| 3957 |
= CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3958 |
pub const CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE: DWORD |
| 3959 |
= CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE_ID << CERT_SYSTEM_STORE_LOCATION_SHIFT; |
| 3960 |
pub const CERT_GROUP_POLICY_SYSTEM_STORE_REGPATH: &'static str |
| 3961 |
= "Software\\Policies\\Microsoft\\SystemCertificates"; |
| 3962 |
pub const CERT_EFSBLOB_REGPATH: &'static str |
| 3963 |
= "Software\\Policies\\Microsoft\\SystemCertificates\\EFS"; |
| 3964 |
pub const CERT_EFSBLOB_VALUE_NAME: &'static str = "EFSBlob"; |
| 3965 |
pub const CERT_PROT_ROOT_FLAGS_REGPATH: &'static str |
| 3966 |
= "Software\\Policies\\Microsoft\\SystemCertificates\\Root\\ProtectedRoots"; |
| 3967 |
pub const CERT_PROT_ROOT_FLAGS_VALUE_NAME: &'static str = "Flags"; |
| 3968 |
pub const CERT_PROT_ROOT_DISABLE_CURRENT_USER_FLAG: DWORD = 0x1; |
| 3969 |
pub const CERT_PROT_ROOT_INHIBIT_ADD_AT_INIT_FLAG: DWORD = 0x2; |
| 3970 |
pub const CERT_PROT_ROOT_INHIBIT_PURGE_LM_FLAG: DWORD = 0x4; |
| 3971 |
pub const CERT_PROT_ROOT_DISABLE_LM_AUTH_FLAG: DWORD = 0x8; |
| 3972 |
pub const CERT_PROT_ROOT_ONLY_LM_GPT_FLAG: DWORD = 0x8; |
| 3973 |
pub const CERT_PROT_ROOT_DISABLE_NT_AUTH_REQUIRED_FLAG: DWORD = 0x10; |
| 3974 |
pub const CERT_PROT_ROOT_DISABLE_NOT_DEFINED_NAME_CONSTRAINT_FLAG: DWORD = 0x20; |
| 3975 |
pub const CERT_PROT_ROOT_DISABLE_PEER_TRUST: DWORD = 0x10000; |
| 3976 |
pub const CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME: &'static str = "PeerUsages"; |
| 3977 |
pub const CERT_PROT_ROOT_PEER_USAGES_VALUE_NAME_A: &'static str = "PeerUsages"; |
| 3978 |
pub const CERT_PROT_ROOT_PEER_USAGES_DEFAULT_A: &'static str |
| 3979 |
= "1.3.6.1.5.5.7.3.2\01.3.6.1.5.5.7.3.4\01.3.6.1.4.1.311.10.3.4\0"; |
| 3980 |
pub const CERT_TRUST_PUB_SAFER_GROUP_POLICY_REGPATH: &'static str |
| 3981 |
= "Software\\Policies\\Microsoft\\SystemCertificates\\TrustedPublisher\\Safer"; |
| 3982 |
pub const CERT_LOCAL_MACHINE_SYSTEM_STORE_REGPATH: &'static str |
| 3983 |
= "Software\\Microsoft\\SystemCertificates"; |
| 3984 |
pub const CERT_TRUST_PUB_SAFER_LOCAL_MACHINE_REGPATH: &'static str |
| 3985 |
= "Software\\Microsoft\\SystemCertificates\\TrustedPublisher\\Safer"; |
| 3986 |
pub const CERT_TRUST_PUB_AUTHENTICODE_FLAGS_VALUE_NAME: &'static str = "AuthenticodeFlags"; |
| 3987 |
pub const CERT_TRUST_PUB_ALLOW_TRUST_MASK: DWORD = 0x00000003; |
| 3988 |
pub const CERT_TRUST_PUB_ALLOW_END_USER_TRUST: DWORD = 0x00000000; |
| 3989 |
pub const CERT_TRUST_PUB_ALLOW_MACHINE_ADMIN_TRUST: DWORD = 0x00000001; |
| 3990 |
pub const CERT_TRUST_PUB_ALLOW_ENTERPRISE_ADMIN_TRUST: DWORD = 0x00000002; |
| 3991 |
pub const CERT_TRUST_PUB_CHECK_PUBLISHER_REV_FLAG: DWORD = 0x00000100; |
| 3992 |
pub const CERT_TRUST_PUB_CHECK_TIMESTAMP_REV_FLAG: DWORD = 0x00000200; |
| 3993 |
pub const CERT_OCM_SUBCOMPONENTS_LOCAL_MACHINE_REGPATH: &'static str |
| 3994 |
= "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OC Manager\\Subcomponents"; |
| 3995 |
pub const CERT_OCM_SUBCOMPONENTS_ROOT_AUTO_UPDATE_VALUE_NAME: &'static str = "RootAutoUpdate"; |
| 3996 |
pub const CERT_DISABLE_ROOT_AUTO_UPDATE_REGPATH: &'static str |
| 3997 |
= "Software\\Policies\\Microsoft\\SystemCertificates\\AuthRoot"; |
| 3998 |
pub const CERT_DISABLE_ROOT_AUTO_UPDATE_VALUE_NAME: &'static str = "DisableRootAutoUpdate"; |
| 3999 |
pub const CERT_ENABLE_DISALLOWED_CERT_AUTO_UPDATE_VALUE_NAME: &'static str |
| 4000 |
= "EnableDisallowedCertAutoUpdate"; |
| 4001 |
pub const CERT_DISABLE_PIN_RULES_AUTO_UPDATE_VALUE_NAME: &'static str |
| 4002 |
= "DisablePinRulesAutoUpdate"; |
| 4003 |
pub const CERT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH: &'static str |
| 4004 |
= "Software\\Microsoft\\SystemCertificates\\AuthRoot\\AutoUpdate"; |
| 4005 |
pub const CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME: &'static str = "RootDirUrl"; |
| 4006 |
pub const CERT_AUTO_UPDATE_SYNC_FROM_DIR_URL_VALUE_NAME: &'static str = "SyncFromDirUrl"; |
| 4007 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH: &'static str |
| 4008 |
= CERT_AUTO_UPDATE_LOCAL_MACHINE_REGPATH; |
| 4009 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME: &'static str |
| 4010 |
= CERT_AUTO_UPDATE_ROOT_DIR_URL_VALUE_NAME; |
| 4011 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: &'static str = "SyncDeltaTime"; |
| 4012 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_FLAGS_VALUE_NAME: &'static str = "Flags"; |
| 4013 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_UNTRUSTED_ROOT_LOGGING_FLAG: DWORD = 0x1; |
| 4014 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_DISABLE_PARTIAL_CHAIN_LOGGING_FLAG: DWORD = 0x2; |
| 4015 |
pub const CERT_AUTO_UPDATE_DISABLE_RANDOM_QUERY_STRING_FLAG: DWORD = 0x4; |
| 4016 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME: &'static str = "LastSyncTime"; |
| 4017 |
pub const CERT_AUTH_ROOT_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME: &'static str = "EncodedCt"; |
| 4018 |
pub const CERT_AUTH_ROOT_CTL_FILENAME: &'static str = "authroot.st"; |
| 4019 |
pub const CERT_AUTH_ROOT_CTL_FILENAME_A: &'static str = "authroot.st"; |
| 4020 |
pub const CERT_AUTH_ROOT_CAB_FILENAME: &'static str = "authrootstl.cab"; |
| 4021 |
pub const CERT_AUTH_ROOT_SEQ_FILENAME: &'static str = "authrootseq.txt"; |
| 4022 |
pub const CERT_AUTH_ROOT_CERT_EXT: &'static str = ".crt"; |
| 4023 |
pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: &'static str |
| 4024 |
= "DisallowedCertSyncDeltaTime"; |
| 4025 |
pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME: &'static str |
| 4026 |
= "DisallowedCertLastSyncTime"; |
| 4027 |
pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME: &'static str |
| 4028 |
= "DisallowedCertEncodedCt"; |
| 4029 |
pub const CERT_DISALLOWED_CERT_CTL_FILENAME: &'static str = "disallowedcert.st"; |
| 4030 |
pub const CERT_DISALLOWED_CERT_CTL_FILENAME_A: &'static str = "disallowedcert.st"; |
| 4031 |
pub const CERT_DISALLOWED_CERT_CAB_FILENAME: &'static str = "disallowedcertstl.cab"; |
| 4032 |
pub const CERT_DISALLOWED_CERT_AUTO_UPDATE_LIST_IDENTIFIER: &'static str |
| 4033 |
= "DisallowedCert_AutoUpdate_1"; |
| 4034 |
pub const CERT_PIN_RULES_AUTO_UPDATE_SYNC_DELTA_TIME_VALUE_NAME: &'static str |
| 4035 |
= "PinRulesSyncDeltaTime"; |
| 4036 |
pub const CERT_PIN_RULES_AUTO_UPDATE_LAST_SYNC_TIME_VALUE_NAME: &'static str |
| 4037 |
= "PinRulesLastSyncTime"; |
| 4038 |
pub const CERT_PIN_RULES_AUTO_UPDATE_ENCODED_CTL_VALUE_NAME: &'static str = "PinRulesEncodedCt"; |
| 4039 |
pub const CERT_PIN_RULES_CTL_FILENAME: &'static str = "pinrules.st"; |
| 4040 |
pub const CERT_PIN_RULES_CTL_FILENAME_A: &'static str = "pinrules.st"; |
| 4041 |
pub const CERT_PIN_RULES_CAB_FILENAME: &'static str = "pinrulesstl.cab"; |
| 4042 |
pub const CERT_PIN_RULES_AUTO_UPDATE_LIST_IDENTIFIER: &'static str = "PinRules_AutoUpdate_1"; |
| 4043 |
pub const CERT_REGISTRY_STORE_REMOTE_FLAG: DWORD = 0x10000; |
| 4044 |
pub const CERT_REGISTRY_STORE_SERIALIZED_FLAG: DWORD = 0x20000; |
| 4045 |
pub const CERT_REGISTRY_STORE_CLIENT_GPT_FLAG: DWORD = 0x80000000; |
| 4046 |
pub const CERT_REGISTRY_STORE_LM_GPT_FLAG: DWORD = 0x01000000; |
| 4047 |
STRUCT!{struct CERT_REGISTRY_STORE_CLIENT_GPT_PARA { |
| 4048 |
hKeyBase: HKEY, |
| 4049 |
pwszRegPath: LPWSTR, |
| 4050 |
}} |
| 4051 |
pub type PCERT_REGISTRY_STORE_CLIENT_GPT_PARA = *mut CERT_REGISTRY_STORE_CLIENT_GPT_PARA; |
| 4052 |
pub const CERT_REGISTRY_STORE_ROAMING_FLAG: DWORD = 0x40000; |
| 4053 |
STRUCT!{struct CERT_REGISTRY_STORE_ROAMING_PARA { |
| 4054 |
hKeyBase: HKEY, |
| 4055 |
pwszStoreDirectory: LPWSTR, |
| 4056 |
}} |
| 4057 |
pub type PCERT_REGISTRY_STORE_ROAMING_PARA = *mut CERT_REGISTRY_STORE_ROAMING_PARA; |
| 4058 |
pub const CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG: DWORD = 0x80000; |
| 4059 |
pub const CERT_REGISTRY_STORE_EXTERNAL_FLAG: DWORD = 0x100000; |
| 4060 |
pub const CERT_IE_DIRTY_FLAGS_REGPATH: &'static str |
| 4061 |
= "Software\\Microsoft\\Cryptography\\IEDirtyFlags"; |
| 4062 |
pub const CERT_FILE_STORE_COMMIT_ENABLE_FLAG: DWORD = 0x10000; |
| 4063 |
pub const CERT_LDAP_STORE_SIGN_FLAG: DWORD = 0x10000; |
| 4064 |
pub const CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG: DWORD = 0x20000; |
| 4065 |
pub const CERT_LDAP_STORE_OPENED_FLAG: DWORD = 0x40000; |
| 4066 |
STRUCT!{struct CERT_LDAP_STORE_OPENED_PARA { |
| 4067 |
pvLdapSessionHandle: *mut c_void, |
| 4068 |
pwszLdapUrl: LPCWSTR, |
| 4069 |
}} |
| 4070 |
pub type PCERT_LDAP_STORE_OPENED_PARA = *mut CERT_LDAP_STORE_OPENED_PARA; |
| 4071 |
pub const CERT_LDAP_STORE_UNBIND_FLAG: DWORD = 0x80000; |
| 4072 |
extern "system" { |
| 4073 |
pub fn CertOpenStore( |
| 4074 |
lpszStoreProvider: LPCSTR, |
| 4075 |
dwEncodingType: DWORD, |
| 4076 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 4077 |
dwFlags: DWORD, |
| 4078 |
pvPara: *const c_void, |
| 4079 |
) -> HCERTSTORE; |
| 4080 |
} |
| 4081 |
pub type HCERTSTOREPROV = *mut c_void; |
| 4082 |
pub const CRYPT_OID_OPEN_STORE_PROV_FUNC: &'static str = "CertDllOpenStoreProv"; |
| 4083 |
STRUCT!{struct CERT_STORE_PROV_INFO { |
| 4084 |
cbSize: DWORD, |
| 4085 |
cStoreProvFunc: DWORD, |
| 4086 |
rgpvStoreProvFunc: *mut *mut c_void, |
| 4087 |
hStoreProv: HCERTSTOREPROV, |
| 4088 |
dwStoreProvFlags: DWORD, |
| 4089 |
hStoreProvFuncAddr2: HCRYPTOIDFUNCADDR, |
| 4090 |
}} |
| 4091 |
pub type PCERT_STORE_PROV_INFO = *mut CERT_STORE_PROV_INFO; |
| 4092 |
FN!{stdcall PFN_CERT_DLL_OPEN_STORE_PROV_FUNC( |
| 4093 |
lpszStoreProvider: LPCSTR, |
| 4094 |
dwEncodingType: DWORD, |
| 4095 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 4096 |
dwFlags: DWORD, |
| 4097 |
pvPara: *const c_void, |
| 4098 |
hCertStore: HCERTSTORE, |
| 4099 |
pStoreProvInfo: PCERT_STORE_PROV_INFO, |
| 4100 |
) -> BOOL} |
| 4101 |
pub const CERT_STORE_PROV_EXTERNAL_FLAG: DWORD = 0x1; |
| 4102 |
pub const CERT_STORE_PROV_DELETED_FLAG: DWORD = 0x2; |
| 4103 |
pub const CERT_STORE_PROV_NO_PERSIST_FLAG: DWORD = 0x4; |
| 4104 |
pub const CERT_STORE_PROV_SYSTEM_STORE_FLAG: DWORD = 0x8; |
| 4105 |
pub const CERT_STORE_PROV_LM_SYSTEM_STORE_FLAG: DWORD = 0x10; |
| 4106 |
pub const CERT_STORE_PROV_GP_SYSTEM_STORE_FLAG: DWORD = 0x20; |
| 4107 |
pub const CERT_STORE_PROV_SHARED_USER_FLAG: DWORD = 0x40; |
| 4108 |
pub const CERT_STORE_PROV_CLOSE_FUNC: DWORD = 0; |
| 4109 |
pub const CERT_STORE_PROV_READ_CERT_FUNC: DWORD = 1; |
| 4110 |
pub const CERT_STORE_PROV_WRITE_CERT_FUNC: DWORD = 2; |
| 4111 |
pub const CERT_STORE_PROV_DELETE_CERT_FUNC: DWORD = 3; |
| 4112 |
pub const CERT_STORE_PROV_SET_CERT_PROPERTY_FUNC: DWORD = 4; |
| 4113 |
pub const CERT_STORE_PROV_READ_CRL_FUNC: DWORD = 5; |
| 4114 |
pub const CERT_STORE_PROV_WRITE_CRL_FUNC: DWORD = 6; |
| 4115 |
pub const CERT_STORE_PROV_DELETE_CRL_FUNC: DWORD = 7; |
| 4116 |
pub const CERT_STORE_PROV_SET_CRL_PROPERTY_FUNC: DWORD = 8; |
| 4117 |
pub const CERT_STORE_PROV_READ_CTL_FUNC: DWORD = 9; |
| 4118 |
pub const CERT_STORE_PROV_WRITE_CTL_FUNC: DWORD = 10; |
| 4119 |
pub const CERT_STORE_PROV_DELETE_CTL_FUNC: DWORD = 11; |
| 4120 |
pub const CERT_STORE_PROV_SET_CTL_PROPERTY_FUNC: DWORD = 12; |
| 4121 |
pub const CERT_STORE_PROV_CONTROL_FUNC: DWORD = 13; |
| 4122 |
pub const CERT_STORE_PROV_FIND_CERT_FUNC: DWORD = 14; |
| 4123 |
pub const CERT_STORE_PROV_FREE_FIND_CERT_FUNC: DWORD = 15; |
| 4124 |
pub const CERT_STORE_PROV_GET_CERT_PROPERTY_FUNC: DWORD = 16; |
| 4125 |
pub const CERT_STORE_PROV_FIND_CRL_FUNC: DWORD = 17; |
| 4126 |
pub const CERT_STORE_PROV_FREE_FIND_CRL_FUNC: DWORD = 18; |
| 4127 |
pub const CERT_STORE_PROV_GET_CRL_PROPERTY_FUNC: DWORD = 19; |
| 4128 |
pub const CERT_STORE_PROV_FIND_CTL_FUNC: DWORD = 20; |
| 4129 |
pub const CERT_STORE_PROV_FREE_FIND_CTL_FUNC: DWORD = 21; |
| 4130 |
pub const CERT_STORE_PROV_GET_CTL_PROPERTY_FUNC: DWORD = 22; |
| 4131 |
FN!{stdcall PFN_CERT_STORE_PROV_CLOSE( |
| 4132 |
hStoreProv: HCERTSTOREPROV, |
| 4133 |
dwFlags: DWORD, |
| 4134 |
) -> ()} |
| 4135 |
FN!{stdcall PFN_CERT_STORE_PROV_READ_CERT( |
| 4136 |
hStoreProv: HCERTSTOREPROV, |
| 4137 |
pStoreCertContext: PCCERT_CONTEXT, |
| 4138 |
dwFlags: DWORD, |
| 4139 |
ppProvCertContext: *mut PCCERT_CONTEXT, |
| 4140 |
) -> BOOL} |
| 4141 |
pub const CERT_STORE_PROV_WRITE_ADD_FLAG: DWORD = 0x1; |
| 4142 |
FN!{stdcall PFN_CERT_STORE_PROV_WRITE_CERT( |
| 4143 |
hStoreProv: HCERTSTOREPROV, |
| 4144 |
pCertContext: PCCERT_CONTEXT, |
| 4145 |
dwFlags: DWORD, |
| 4146 |
) -> BOOL} |
| 4147 |
FN!{stdcall PFN_CERT_STORE_PROV_DELETE_CERT( |
| 4148 |
hStoreProv: HCERTSTOREPROV, |
| 4149 |
pCertContext: PCCERT_CONTEXT, |
| 4150 |
dwFlags: DWORD, |
| 4151 |
) -> BOOL} |
| 4152 |
FN!{stdcall PFN_CERT_STORE_PROV_SET_CERT_PROPERTY( |
| 4153 |
hStoreProv: HCERTSTOREPROV, |
| 4154 |
pCertContext: PCCERT_CONTEXT, |
| 4155 |
dwPropId: DWORD, |
| 4156 |
dwFlags: DWORD, |
| 4157 |
pvData: *const c_void, |
| 4158 |
) -> BOOL} |
| 4159 |
FN!{stdcall PFN_CERT_STORE_PROV_READ_CRL( |
| 4160 |
hStoreProv: HCERTSTOREPROV, |
| 4161 |
pStoreCrlContext: PCCRL_CONTEXT, |
| 4162 |
dwFlags: DWORD, |
| 4163 |
ppProvCrlContext: *mut PCCRL_CONTEXT, |
| 4164 |
) -> BOOL} |
| 4165 |
FN!{stdcall PFN_CERT_STORE_PROV_WRITE_CRL( |
| 4166 |
hStoreProv: HCERTSTOREPROV, |
| 4167 |
pCrlContext: PCCRL_CONTEXT, |
| 4168 |
dwFlags: DWORD, |
| 4169 |
) -> BOOL} |
| 4170 |
FN!{stdcall PFN_CERT_STORE_PROV_DELETE_CRL( |
| 4171 |
hStoreProv: HCERTSTOREPROV, |
| 4172 |
pCrlContext: PCCRL_CONTEXT, |
| 4173 |
dwFlags: DWORD, |
| 4174 |
) -> BOOL} |
| 4175 |
FN!{stdcall PFN_CERT_STORE_PROV_SET_CRL_PROPERTY( |
| 4176 |
hStoreProv: HCERTSTOREPROV, |
| 4177 |
pCrlContext: PCCRL_CONTEXT, |
| 4178 |
dwPropId: DWORD, |
| 4179 |
dwFlags: DWORD, |
| 4180 |
pvData: *const c_void, |
| 4181 |
) -> BOOL} |
| 4182 |
FN!{stdcall PFN_CERT_STORE_PROV_READ_CTL( |
| 4183 |
hStoreProv: HCERTSTOREPROV, |
| 4184 |
pStoreCtlContext: PCCTL_CONTEXT, |
| 4185 |
dwFlags: DWORD, |
| 4186 |
ppProvCtlContext: *mut PCCTL_CONTEXT, |
| 4187 |
) -> BOOL} |
| 4188 |
FN!{stdcall PFN_CERT_STORE_PROV_WRITE_CTL( |
| 4189 |
hStoreProv: HCERTSTOREPROV, |
| 4190 |
pCtlContext: PCCTL_CONTEXT, |
| 4191 |
dwFlags: DWORD, |
| 4192 |
) -> BOOL} |
| 4193 |
FN!{stdcall PFN_CERT_STORE_PROV_DELETE_CTL( |
| 4194 |
hStoreProv: HCERTSTOREPROV, |
| 4195 |
pCtlContext: PCCTL_CONTEXT, |
| 4196 |
dwFlags: DWORD, |
| 4197 |
) -> BOOL} |
| 4198 |
FN!{stdcall PFN_CERT_STORE_PROV_SET_CTL_PROPERTY( |
| 4199 |
hStoreProv: HCERTSTOREPROV, |
| 4200 |
pCtlContext: PCCTL_CONTEXT, |
| 4201 |
dwPropId: DWORD, |
| 4202 |
dwFlags: DWORD, |
| 4203 |
pvData: *const c_void, |
| 4204 |
) -> BOOL} |
| 4205 |
FN!{stdcall PFN_CERT_STORE_PROV_CONTROL( |
| 4206 |
hStoreProv: HCERTSTOREPROV, |
| 4207 |
dwFlags: DWORD, |
| 4208 |
dwCtrlType: DWORD, |
| 4209 |
pvCtrlPara: *const c_void, |
| 4210 |
) -> BOOL} |
| 4211 |
STRUCT!{struct CERT_STORE_PROV_FIND_INFO { |
| 4212 |
cbSize: DWORD, |
| 4213 |
dwMsgAndCertEncodingType: DWORD, |
| 4214 |
dwFindFlags: DWORD, |
| 4215 |
dwFindType: DWORD, |
| 4216 |
pvFindPara: *const c_void, |
| 4217 |
}} |
| 4218 |
pub type PCERT_STORE_PROV_FIND_INFO = *mut CERT_STORE_PROV_FIND_INFO; |
| 4219 |
pub type CCERT_STORE_PROV_FIND_INFO = CERT_STORE_PROV_FIND_INFO; |
| 4220 |
pub type PCCERT_STORE_PROV_FIND_INFO = *const CERT_STORE_PROV_FIND_INFO; |
| 4221 |
FN!{stdcall PFN_CERT_STORE_PROV_FIND_CERT( |
| 4222 |
hStoreProv: HCERTSTOREPROV, |
| 4223 |
pFindInfo: PCCERT_STORE_PROV_FIND_INFO, |
| 4224 |
pPrevCertContext: PCCERT_CONTEXT, |
| 4225 |
dwFlags: DWORD, |
| 4226 |
ppvStoreProvFindInfo: *mut *mut c_void, |
| 4227 |
ppProvCertContext: *mut PCCERT_CONTEXT, |
| 4228 |
) -> BOOL} |
| 4229 |
FN!{stdcall PFN_CERT_STORE_PROV_FREE_FIND_CERT( |
| 4230 |
hStoreProv: HCERTSTOREPROV, |
| 4231 |
pCertContext: PCCERT_CONTEXT, |
| 4232 |
pvStoreProvFindInfo: *mut c_void, |
| 4233 |
dwFlags: DWORD, |
| 4234 |
) -> BOOL} |
| 4235 |
FN!{stdcall PFN_CERT_STORE_PROV_GET_CERT_PROPERTY( |
| 4236 |
hStoreProv: HCERTSTOREPROV, |
| 4237 |
pCertContext: PCCERT_CONTEXT, |
| 4238 |
dwPropId: DWORD, |
| 4239 |
dwFlags: DWORD, |
| 4240 |
pvData: *mut c_void, |
| 4241 |
pcbData: *mut DWORD, |
| 4242 |
) -> BOOL} |
| 4243 |
FN!{stdcall PFN_CERT_STORE_PROV_FIND_CRL( |
| 4244 |
hStoreProv: HCERTSTOREPROV, |
| 4245 |
pFindInfo: PCCERT_STORE_PROV_FIND_INFO, |
| 4246 |
pPrevCrlContext: PCCRL_CONTEXT, |
| 4247 |
dwFlags: DWORD, |
| 4248 |
ppvStoreProvFindInfo: *mut *mut c_void, |
| 4249 |
ppProvCrlContext: *mut PCCRL_CONTEXT, |
| 4250 |
) -> BOOL} |
| 4251 |
FN!{stdcall PFN_CERT_STORE_PROV_FREE_FIND_CRL( |
| 4252 |
hStoreProv: HCERTSTOREPROV, |
| 4253 |
pCrlContext: PCCRL_CONTEXT, |
| 4254 |
pvStoreProvFindInfo: *mut c_void, |
| 4255 |
dwFlags: DWORD, |
| 4256 |
) -> BOOL} |
| 4257 |
FN!{stdcall PFN_CERT_STORE_PROV_GET_CRL_PROPERTY( |
| 4258 |
hStoreProv: HCERTSTOREPROV, |
| 4259 |
pCrlContext: PCCRL_CONTEXT, |
| 4260 |
dwPropId: DWORD, |
| 4261 |
dwFlags: DWORD, |
| 4262 |
pvData: *mut c_void, |
| 4263 |
pcbData: *mut DWORD, |
| 4264 |
) -> BOOL} |
| 4265 |
FN!{stdcall PFN_CERT_STORE_PROV_FIND_CTL( |
| 4266 |
hStoreProv: HCERTSTOREPROV, |
| 4267 |
pFindInfo: PCCERT_STORE_PROV_FIND_INFO, |
| 4268 |
pPrevCtlContext: PCCTL_CONTEXT, |
| 4269 |
dwFlags: DWORD, |
| 4270 |
ppvStoreProvFindInfo: *mut *mut c_void, |
| 4271 |
ppProvCtlContext: *mut PCCTL_CONTEXT, |
| 4272 |
) -> BOOL} |
| 4273 |
FN!{stdcall PFN_CERT_STORE_PROV_FREE_FIND_CTL( |
| 4274 |
hStoreProv: HCERTSTOREPROV, |
| 4275 |
pCtlContext: PCCTL_CONTEXT, |
| 4276 |
pvStoreProvFindInfo: *mut c_void, |
| 4277 |
dwFlags: DWORD, |
| 4278 |
) -> BOOL} |
| 4279 |
FN!{stdcall PFN_CERT_STORE_PROV_GET_CTL_PROPERTY( |
| 4280 |
hStoreProv: HCERTSTOREPROV, |
| 4281 |
pCtlContext: PCCTL_CONTEXT, |
| 4282 |
dwPropId: DWORD, |
| 4283 |
dwFlags: DWORD, |
| 4284 |
pvData: *mut c_void, |
| 4285 |
pcbData: *mut DWORD, |
| 4286 |
) -> BOOL} |
| 4287 |
extern "system" { |
| 4288 |
pub fn CertDuplicateStore( |
| 4289 |
hCertStore: HCERTSTORE, |
| 4290 |
) -> HCERTSTORE; |
| 4291 |
} |
| 4292 |
pub const CERT_STORE_SAVE_AS_STORE: DWORD = 1; |
| 4293 |
pub const CERT_STORE_SAVE_AS_PKCS7: DWORD = 2; |
| 4294 |
pub const CERT_STORE_SAVE_AS_PKCS12: DWORD = 3; |
| 4295 |
pub const CERT_STORE_SAVE_TO_FILE: DWORD = 1; |
| 4296 |
pub const CERT_STORE_SAVE_TO_MEMORY: DWORD = 2; |
| 4297 |
pub const CERT_STORE_SAVE_TO_FILENAME_A: DWORD = 3; |
| 4298 |
pub const CERT_STORE_SAVE_TO_FILENAME_W: DWORD = 4; |
| 4299 |
pub const CERT_STORE_SAVE_TO_FILENAME: DWORD = CERT_STORE_SAVE_TO_FILENAME_W; |
| 4300 |
extern "system" { |
| 4301 |
pub fn CertSaveStore( |
| 4302 |
hCertStore: HCERTSTORE, |
| 4303 |
dwEncodingType: DWORD, |
| 4304 |
dwSaveAs: DWORD, |
| 4305 |
dwSaveTo: DWORD, |
| 4306 |
pvSaveToPara: *mut c_void, |
| 4307 |
dwFlags: DWORD, |
| 4308 |
) -> BOOL; |
| 4309 |
} |
| 4310 |
pub const CERT_CLOSE_STORE_FORCE_FLAG: DWORD = 0x00000001; |
| 4311 |
pub const CERT_CLOSE_STORE_CHECK_FLAG: DWORD = 0x00000002; |
| 4312 |
extern "system" { |
| 4313 |
pub fn CertCloseStore( |
| 4314 |
hCertStore: HCERTSTORE, |
| 4315 |
dwFlags: DWORD, |
| 4316 |
) -> BOOL; |
| 4317 |
pub fn CertGetSubjectCertificateFromStore( |
| 4318 |
hCertStore: HCERTSTORE, |
| 4319 |
dwCertEncodingType: DWORD, |
| 4320 |
pCertId: PCERT_INFO, |
| 4321 |
) -> PCCERT_CONTEXT; |
| 4322 |
pub fn CertEnumCertificatesInStore( |
| 4323 |
hCertStore: HCERTSTORE, |
| 4324 |
pPrevCertContext: PCCERT_CONTEXT, |
| 4325 |
) -> PCCERT_CONTEXT; |
| 4326 |
pub fn CertFindCertificateInStore( |
| 4327 |
hCertStore: HCERTSTORE, |
| 4328 |
dwCertEncodingType: DWORD, |
| 4329 |
dwFindFlags: DWORD, |
| 4330 |
dwFindType: DWORD, |
| 4331 |
pvFindPara: *const c_void, |
| 4332 |
pPrevCertContext: PCCERT_CONTEXT, |
| 4333 |
) -> PCCERT_CONTEXT; |
| 4334 |
} |
| 4335 |
pub const CERT_COMPARE_MASK: DWORD = 0xFFFF; |
| 4336 |
pub const CERT_COMPARE_SHIFT: DWORD = 16; |
| 4337 |
pub const CERT_COMPARE_ANY: DWORD = 0; |
| 4338 |
pub const CERT_COMPARE_SHA1_HASH: DWORD = 1; |
| 4339 |
pub const CERT_COMPARE_NAME: DWORD = 2; |
| 4340 |
pub const CERT_COMPARE_ATTR: DWORD = 3; |
| 4341 |
pub const CERT_COMPARE_MD5_HASH: DWORD = 4; |
| 4342 |
pub const CERT_COMPARE_PROPERTY: DWORD = 5; |
| 4343 |
pub const CERT_COMPARE_PUBLIC_KEY: DWORD = 6; |
| 4344 |
pub const CERT_COMPARE_HASH: DWORD = CERT_COMPARE_SHA1_HASH; |
| 4345 |
pub const CERT_COMPARE_NAME_STR_A: DWORD = 7; |
| 4346 |
pub const CERT_COMPARE_NAME_STR_W: DWORD = 8; |
| 4347 |
pub const CERT_COMPARE_KEY_SPEC: DWORD = 9; |
| 4348 |
pub const CERT_COMPARE_ENHKEY_USAGE: DWORD = 10; |
| 4349 |
pub const CERT_COMPARE_CTL_USAGE: DWORD = CERT_COMPARE_ENHKEY_USAGE; |
| 4350 |
pub const CERT_COMPARE_SUBJECT_CERT: DWORD = 11; |
| 4351 |
pub const CERT_COMPARE_ISSUER_OF: DWORD = 12; |
| 4352 |
pub const CERT_COMPARE_EXISTING: DWORD = 13; |
| 4353 |
pub const CERT_COMPARE_SIGNATURE_HASH: DWORD = 14; |
| 4354 |
pub const CERT_COMPARE_KEY_IDENTIFIER: DWORD = 15; |
| 4355 |
pub const CERT_COMPARE_CERT_ID: DWORD = 16; |
| 4356 |
pub const CERT_COMPARE_CROSS_CERT_DIST_POINTS: DWORD = 17; |
| 4357 |
pub const CERT_COMPARE_PUBKEY_MD5_HASH: DWORD = 18; |
| 4358 |
pub const CERT_COMPARE_SUBJECT_INFO_ACCESS: DWORD = 19; |
| 4359 |
pub const CERT_COMPARE_HASH_STR: DWORD = 20; |
| 4360 |
pub const CERT_COMPARE_HAS_PRIVATE_KEY: DWORD = 21; |
| 4361 |
pub const CERT_FIND_ANY: DWORD = CERT_COMPARE_ANY << CERT_COMPARE_SHIFT; |
| 4362 |
pub const CERT_FIND_SHA1_HASH: DWORD = CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT; |
| 4363 |
pub const CERT_FIND_MD5_HASH: DWORD = CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT; |
| 4364 |
pub const CERT_FIND_SIGNATURE_HASH: DWORD = CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT; |
| 4365 |
pub const CERT_FIND_KEY_IDENTIFIER: DWORD = CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT; |
| 4366 |
pub const CERT_FIND_HASH: DWORD = CERT_FIND_SHA1_HASH; |
| 4367 |
pub const CERT_FIND_PROPERTY: DWORD = CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT; |
| 4368 |
pub const CERT_FIND_PUBLIC_KEY: DWORD = CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT; |
| 4369 |
pub const CERT_FIND_SUBJECT_NAME: DWORD = (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT) |
| 4370 |
| CERT_INFO_SUBJECT_FLAG; |
| 4371 |
pub const CERT_FIND_SUBJECT_ATTR: DWORD = (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT) |
| 4372 |
| CERT_INFO_SUBJECT_FLAG; |
| 4373 |
pub const CERT_FIND_ISSUER_NAME: DWORD = (CERT_COMPARE_NAME << CERT_COMPARE_SHIFT) |
| 4374 |
| CERT_INFO_ISSUER_FLAG; |
| 4375 |
pub const CERT_FIND_ISSUER_ATTR: DWORD = (CERT_COMPARE_ATTR << CERT_COMPARE_SHIFT) |
| 4376 |
| CERT_INFO_ISSUER_FLAG; |
| 4377 |
pub const CERT_FIND_SUBJECT_STR_A: DWORD = (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT) |
| 4378 |
| CERT_INFO_SUBJECT_FLAG; |
| 4379 |
pub const CERT_FIND_SUBJECT_STR_W: DWORD = (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT) |
| 4380 |
| CERT_INFO_SUBJECT_FLAG; |
| 4381 |
pub const CERT_FIND_SUBJECT_STR: DWORD = CERT_FIND_SUBJECT_STR_W; |
| 4382 |
pub const CERT_FIND_ISSUER_STR_A: DWORD = (CERT_COMPARE_NAME_STR_A << CERT_COMPARE_SHIFT) |
| 4383 |
| CERT_INFO_ISSUER_FLAG; |
| 4384 |
pub const CERT_FIND_ISSUER_STR_W: DWORD = (CERT_COMPARE_NAME_STR_W << CERT_COMPARE_SHIFT) |
| 4385 |
| CERT_INFO_ISSUER_FLAG; |
| 4386 |
pub const CERT_FIND_ISSUER_STR: DWORD = CERT_FIND_ISSUER_STR_W; |
| 4387 |
pub const CERT_FIND_KEY_SPEC: DWORD = CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT; |
| 4388 |
pub const CERT_FIND_ENHKEY_USAGE: DWORD = CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT; |
| 4389 |
pub const CERT_FIND_CTL_USAGE: DWORD = CERT_FIND_ENHKEY_USAGE; |
| 4390 |
pub const CERT_FIND_SUBJECT_CERT: DWORD = CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT; |
| 4391 |
pub const CERT_FIND_ISSUER_OF: DWORD = CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT; |
| 4392 |
pub const CERT_FIND_EXISTING: DWORD = CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT; |
| 4393 |
pub const CERT_FIND_CERT_ID: DWORD = CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT; |
| 4394 |
pub const CERT_FIND_CROSS_CERT_DIST_POINTS: DWORD = CERT_COMPARE_CROSS_CERT_DIST_POINTS |
| 4395 |
<< CERT_COMPARE_SHIFT; |
| 4396 |
pub const CERT_FIND_PUBKEY_MD5_HASH: DWORD = CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT; |
| 4397 |
pub const CERT_FIND_SUBJECT_INFO_ACCESS: DWORD = CERT_COMPARE_SUBJECT_INFO_ACCESS |
| 4398 |
<< CERT_COMPARE_SHIFT; |
| 4399 |
pub const CERT_FIND_HASH_STR: DWORD = CERT_COMPARE_HASH_STR << CERT_COMPARE_SHIFT; |
| 4400 |
pub const CERT_FIND_HAS_PRIVATE_KEY: DWORD = CERT_COMPARE_HAS_PRIVATE_KEY << CERT_COMPARE_SHIFT; |
| 4401 |
pub const CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG: DWORD = 0x1; |
| 4402 |
pub const CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG: DWORD = 0x2; |
| 4403 |
pub const CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG: DWORD = 0x4; |
| 4404 |
pub const CERT_FIND_NO_ENHKEY_USAGE_FLAG: DWORD = 0x8; |
| 4405 |
pub const CERT_FIND_OR_ENHKEY_USAGE_FLAG: DWORD = 0x10; |
| 4406 |
pub const CERT_FIND_VALID_ENHKEY_USAGE_FLAG: DWORD = 0x20; |
| 4407 |
pub const CERT_FIND_OPTIONAL_CTL_USAGE_FLAG: DWORD = CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG; |
| 4408 |
pub const CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG: DWORD = CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG; |
| 4409 |
pub const CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG: DWORD = CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG; |
| 4410 |
pub const CERT_FIND_NO_CTL_USAGE_FLAG: DWORD = CERT_FIND_NO_ENHKEY_USAGE_FLAG; |
| 4411 |
pub const CERT_FIND_OR_CTL_USAGE_FLAG: DWORD = CERT_FIND_OR_ENHKEY_USAGE_FLAG; |
| 4412 |
pub const CERT_FIND_VALID_CTL_USAGE_FLAG: DWORD = CERT_FIND_VALID_ENHKEY_USAGE_FLAG; |
| 4413 |
extern "system" { |
| 4414 |
pub fn CertGetIssuerCertificateFromStore( |
| 4415 |
hCertStore: HCERTSTORE, |
| 4416 |
pSubjectContext: PCCERT_CONTEXT, |
| 4417 |
pPrevIssuerContext: PCCERT_CONTEXT, |
| 4418 |
pdwFlags: *mut DWORD, |
| 4419 |
) -> PCCERT_CONTEXT; |
| 4420 |
pub fn CertVerifySubjectCertificateContext( |
| 4421 |
pSubject: PCCERT_CONTEXT, |
| 4422 |
pIssuer: PCCERT_CONTEXT, |
| 4423 |
pdwFlags: *mut DWORD, |
| 4424 |
) -> BOOL; |
| 4425 |
pub fn CertDuplicateCertificateContext( |
| 4426 |
pCertContext: PCCERT_CONTEXT, |
| 4427 |
) -> PCCERT_CONTEXT; |
| 4428 |
pub fn CertCreateCertificateContext( |
| 4429 |
dwCertEncodingType: DWORD, |
| 4430 |
pbCertEncoded: *const BYTE, |
| 4431 |
cbCertEncoded: DWORD, |
| 4432 |
) -> PCCERT_CONTEXT; |
| 4433 |
pub fn CertFreeCertificateContext( |
| 4434 |
pCertContext: PCCERT_CONTEXT, |
| 4435 |
) -> BOOL; |
| 4436 |
pub fn CertSetCertificateContextProperty( |
| 4437 |
pCertContext: PCCERT_CONTEXT, |
| 4438 |
dwPropId: DWORD, |
| 4439 |
dwFlags: DWORD, |
| 4440 |
pvData: *const c_void, |
| 4441 |
) -> BOOL; |
| 4442 |
} |
| 4443 |
pub const CERT_SET_PROPERTY_IGNORE_PERSIST_ERROR_FLAG: DWORD = 0x80000000; |
| 4444 |
pub const CERT_SET_PROPERTY_INHIBIT_PERSIST_FLAG: DWORD = 0x40000000; |
| 4445 |
extern "system" { |
| 4446 |
pub fn CertGetCertificateContextProperty( |
| 4447 |
pCertContext: PCCERT_CONTEXT, |
| 4448 |
dwPropId: DWORD, |
| 4449 |
pvData: *mut c_void, |
| 4450 |
pcbData: *mut DWORD, |
| 4451 |
) -> BOOL; |
| 4452 |
pub fn CertEnumCertificateContextProperties( |
| 4453 |
pCertContext: PCCERT_CONTEXT, |
| 4454 |
dwPropId: DWORD, |
| 4455 |
) -> DWORD; |
| 4456 |
pub fn CertCreateCTLEntryFromCertificateContextProperties( |
| 4457 |
pCertContext: PCCERT_CONTEXT, |
| 4458 |
cOptAttr: DWORD, |
| 4459 |
rgOptAttr: PCRYPT_ATTRIBUTE, |
| 4460 |
dwFlags: DWORD, |
| 4461 |
pvReserved: *mut c_void, |
| 4462 |
pCtlEntry: PCTL_ENTRY, |
| 4463 |
pcbCtlEntry: *mut DWORD, |
| 4464 |
) -> BOOL; |
| 4465 |
pub fn CertSetCertificateContextPropertiesFromCTLEntry( |
| 4466 |
pCertContext: PCCERT_CONTEXT, |
| 4467 |
pCtlEntry: PCTL_ENTRY, |
| 4468 |
dwFlags: DWORD, |
| 4469 |
) -> BOOL; |
| 4470 |
pub fn CertGetCRLFromStore( |
| 4471 |
hCertStore: HCERTSTORE, |
| 4472 |
pIssuerContext: PCCERT_CONTEXT, |
| 4473 |
pPrevCrlContext: PCCRL_CONTEXT, |
| 4474 |
pdwFlags: *mut DWORD, |
| 4475 |
) -> PCCRL_CONTEXT; |
| 4476 |
pub fn CertEnumCRLsInStore( |
| 4477 |
hCertStore: HCERTSTORE, |
| 4478 |
pPrevCrlContext: PCCRL_CONTEXT, |
| 4479 |
) -> PCCRL_CONTEXT; |
| 4480 |
pub fn CertFindCRLInStore( |
| 4481 |
hCertStore: HCERTSTORE, |
| 4482 |
dwCertEncodingType: DWORD, |
| 4483 |
dwFindFlags: DWORD, |
| 4484 |
dwFindType: DWORD, |
| 4485 |
pvFindPara: *const c_void, |
| 4486 |
pPrevCrlContext: PCCRL_CONTEXT, |
| 4487 |
) -> PCCRL_CONTEXT; |
| 4488 |
} |
| 4489 |
pub const CRL_FIND_ANY: DWORD = 0; |
| 4490 |
pub const CRL_FIND_ISSUED_BY: DWORD = 1; |
| 4491 |
pub const CRL_FIND_EXISTING: DWORD = 2; |
| 4492 |
pub const CRL_FIND_ISSUED_FOR: DWORD = 3; |
| 4493 |
pub const CRL_FIND_ISSUED_BY_AKI_FLAG: DWORD = 0x1; |
| 4494 |
pub const CRL_FIND_ISSUED_BY_SIGNATURE_FLAG: DWORD = 0x2; |
| 4495 |
pub const CRL_FIND_ISSUED_BY_DELTA_FLAG: DWORD = 0x4; |
| 4496 |
pub const CRL_FIND_ISSUED_BY_BASE_FLAG: DWORD = 0x8; |
| 4497 |
STRUCT!{struct CRL_FIND_ISSUED_FOR_PARA { |
| 4498 |
pSubjectCert: PCCERT_CONTEXT, |
| 4499 |
pIssuerCert: PCCERT_CONTEXT, |
| 4500 |
}} |
| 4501 |
pub type PCRL_FIND_ISSUED_FOR_PARA = *mut CRL_FIND_ISSUED_FOR_PARA; |
| 4502 |
pub const CRL_FIND_ISSUED_FOR_SET_STRONG_PROPERTIES_FLAG: DWORD = 0x10; |
| 4503 |
extern "system" { |
| 4504 |
pub fn CertDuplicateCRLContext( |
| 4505 |
pCrlContext: PCCRL_CONTEXT, |
| 4506 |
) -> PCCRL_CONTEXT; |
| 4507 |
pub fn CertCreateCRLContext( |
| 4508 |
dwCertEncodingType: DWORD, |
| 4509 |
pbCrlEncoded: *const BYTE, |
| 4510 |
cbCrlEncoded: DWORD, |
| 4511 |
) -> PCCRL_CONTEXT; |
| 4512 |
pub fn CertFreeCRLContext( |
| 4513 |
pCrlContext: PCCRL_CONTEXT, |
| 4514 |
) -> BOOL; |
| 4515 |
pub fn CertSetCRLContextProperty( |
| 4516 |
pCrlContext: PCCRL_CONTEXT, |
| 4517 |
dwPropId: DWORD, |
| 4518 |
dwFlags: DWORD, |
| 4519 |
pvData: *const c_void, |
| 4520 |
) -> BOOL; |
| 4521 |
pub fn CertGetCRLContextProperty( |
| 4522 |
pCrlContext: PCCRL_CONTEXT, |
| 4523 |
dwPropId: DWORD, |
| 4524 |
pvData: *mut c_void, |
| 4525 |
pcbData: *mut DWORD, |
| 4526 |
) -> BOOL; |
| 4527 |
pub fn CertEnumCRLContextProperties( |
| 4528 |
pCrlContext: PCCRL_CONTEXT, |
| 4529 |
dwPropId: DWORD, |
| 4530 |
) -> DWORD; |
| 4531 |
pub fn CertFindCertificateInCRL( |
| 4532 |
pCert: PCCERT_CONTEXT, |
| 4533 |
pCrlContext: PCCRL_CONTEXT, |
| 4534 |
dwFlags: DWORD, |
| 4535 |
pvReserved: *mut c_void, |
| 4536 |
ppCrlEntry: *mut PCRL_ENTRY, |
| 4537 |
) -> BOOL; |
| 4538 |
pub fn CertIsValidCRLForCertificate( |
| 4539 |
pCert: PCCERT_CONTEXT, |
| 4540 |
pCrl: PCCRL_CONTEXT, |
| 4541 |
dwFlags: DWORD, |
| 4542 |
pvReserved: *mut c_void, |
| 4543 |
) -> BOOL; |
| 4544 |
} |
| 4545 |
pub const CERT_STORE_ADD_NEW: DWORD = 1; |
| 4546 |
pub const CERT_STORE_ADD_USE_EXISTING: DWORD = 2; |
| 4547 |
pub const CERT_STORE_ADD_REPLACE_EXISTING: DWORD = 3; |
| 4548 |
pub const CERT_STORE_ADD_ALWAYS: DWORD = 4; |
| 4549 |
pub const CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES: DWORD = 5; |
| 4550 |
pub const CERT_STORE_ADD_NEWER: DWORD = 6; |
| 4551 |
pub const CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: DWORD = 7; |
| 4552 |
extern "system" { |
| 4553 |
pub fn CertAddEncodedCertificateToStore( |
| 4554 |
hCertStore: HCERTSTORE, |
| 4555 |
dwCertEncodingType: DWORD, |
| 4556 |
pbCertEncoded: *const BYTE, |
| 4557 |
cbCertEncoded: DWORD, |
| 4558 |
dwAddDisposition: DWORD, |
| 4559 |
ppCertContext: *mut PCCERT_CONTEXT, |
| 4560 |
) -> BOOL; |
| 4561 |
pub fn CertAddCertificateContextToStore( |
| 4562 |
hCertStore: HCERTSTORE, |
| 4563 |
pCertContext: PCCERT_CONTEXT, |
| 4564 |
dwAddDisposition: DWORD, |
| 4565 |
ppStoreContext: *mut PCCERT_CONTEXT, |
| 4566 |
) -> BOOL; |
| 4567 |
} |
| 4568 |
pub const CERT_STORE_CERTIFICATE_CONTEXT: DWORD = 1; |
| 4569 |
pub const CERT_STORE_CRL_CONTEXT: DWORD = 2; |
| 4570 |
pub const CERT_STORE_CTL_CONTEXT: DWORD = 3; |
| 4571 |
pub const CERT_STORE_ALL_CONTEXT_FLAG: DWORD = !0; |
| 4572 |
pub const CERT_STORE_CERTIFICATE_CONTEXT_FLAG: DWORD = 1 << CERT_STORE_CERTIFICATE_CONTEXT; |
| 4573 |
pub const CERT_STORE_CRL_CONTEXT_FLAG: DWORD = 1 << CERT_STORE_CRL_CONTEXT; |
| 4574 |
pub const CERT_STORE_CTL_CONTEXT_FLAG: DWORD = 1 << CERT_STORE_CTL_CONTEXT; |
| 4575 |
extern "system" { |
| 4576 |
pub fn CertAddSerializedElementToStore( |
| 4577 |
hCertStore: HCERTSTORE, |
| 4578 |
pbElement: *const BYTE, |
| 4579 |
cbElement: DWORD, |
| 4580 |
dwAddDisposition: DWORD, |
| 4581 |
dwFlags: DWORD, |
| 4582 |
dwContextTypeFlags: DWORD, |
| 4583 |
pdwContextType: *mut DWORD, |
| 4584 |
ppvContext: *mut *const c_void, |
| 4585 |
) -> BOOL; |
| 4586 |
pub fn CertDeleteCertificateFromStore( |
| 4587 |
pCertContext: PCCERT_CONTEXT, |
| 4588 |
) -> BOOL; |
| 4589 |
pub fn CertAddEncodedCRLToStore( |
| 4590 |
hCertStore: HCERTSTORE, |
| 4591 |
dwCertEncodingType: DWORD, |
| 4592 |
pbCrlEncoded: *const BYTE, |
| 4593 |
cbCrlEncoded: DWORD, |
| 4594 |
dwAddDisposition: DWORD, |
| 4595 |
ppCrlContext: *mut PCCRL_CONTEXT, |
| 4596 |
) -> BOOL; |
| 4597 |
pub fn CertAddCRLContextToStore( |
| 4598 |
hCertStore: HCERTSTORE, |
| 4599 |
pCrlContext: PCCRL_CONTEXT, |
| 4600 |
dwAddDisposition: DWORD, |
| 4601 |
ppStoreContext: *mut PCCRL_CONTEXT, |
| 4602 |
) -> BOOL; |
| 4603 |
pub fn CertDeleteCRLFromStore( |
| 4604 |
pCrlContext: PCCRL_CONTEXT, |
| 4605 |
) -> BOOL; |
| 4606 |
pub fn CertSerializeCertificateStoreElement( |
| 4607 |
pCertContext: PCCERT_CONTEXT, |
| 4608 |
dwFlags: DWORD, |
| 4609 |
pbElement: *mut BYTE, |
| 4610 |
pcbElement: *mut DWORD, |
| 4611 |
) -> BOOL; |
| 4612 |
pub fn CertSerializeCRLStoreElement( |
| 4613 |
pCrlContext: PCCRL_CONTEXT, |
| 4614 |
dwFlags: DWORD, |
| 4615 |
pbElement: *mut BYTE, |
| 4616 |
pcbElement: *mut DWORD, |
| 4617 |
) -> BOOL; |
| 4618 |
pub fn CertDuplicateCTLContext( |
| 4619 |
pCtlContext: PCCTL_CONTEXT, |
| 4620 |
) -> PCCTL_CONTEXT; |
| 4621 |
pub fn CertCreateCTLContext( |
| 4622 |
dwMsgAndCertEncodingType: DWORD, |
| 4623 |
pbCtlEncoded: *const BYTE, |
| 4624 |
cbCtlEncoded: DWORD, |
| 4625 |
) -> PCCTL_CONTEXT; |
| 4626 |
pub fn CertFreeCTLContext( |
| 4627 |
pCtlContext: PCCTL_CONTEXT, |
| 4628 |
) -> BOOL; |
| 4629 |
pub fn CertSetCTLContextProperty( |
| 4630 |
pCtlContext: PCCTL_CONTEXT, |
| 4631 |
dwPropId: DWORD, |
| 4632 |
dwFlags: DWORD, |
| 4633 |
pvData: *const c_void, |
| 4634 |
) -> BOOL; |
| 4635 |
pub fn CertGetCTLContextProperty( |
| 4636 |
pCtlContext: PCCTL_CONTEXT, |
| 4637 |
dwPropId: DWORD, |
| 4638 |
pvData: *mut c_void, |
| 4639 |
pcbData: *mut DWORD, |
| 4640 |
) -> BOOL; |
| 4641 |
pub fn CertEnumCTLContextProperties( |
| 4642 |
pCtlContext: PCCTL_CONTEXT, |
| 4643 |
dwPropId: DWORD, |
| 4644 |
) -> DWORD; |
| 4645 |
pub fn CertEnumCTLsInStore( |
| 4646 |
hCertStore: HCERTSTORE, |
| 4647 |
pPrevCtlContext: PCCTL_CONTEXT, |
| 4648 |
) -> PCCTL_CONTEXT; |
| 4649 |
pub fn CertFindSubjectInCTL( |
| 4650 |
dwEncodingType: DWORD, |
| 4651 |
dwSubjectType: DWORD, |
| 4652 |
pvSubject: *mut c_void, |
| 4653 |
pCtlContext: PCCTL_CONTEXT, |
| 4654 |
dwFlags: DWORD, |
| 4655 |
) -> PCTL_ENTRY; |
| 4656 |
} |
| 4657 |
pub const CTL_ANY_SUBJECT_TYPE: DWORD = 1; |
| 4658 |
pub const CTL_CERT_SUBJECT_TYPE: DWORD = 2; |
| 4659 |
STRUCT!{struct CTL_ANY_SUBJECT_INFO { |
| 4660 |
SubjectAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 4661 |
SubjectIdentifier: CRYPT_DATA_BLOB, |
| 4662 |
}} |
| 4663 |
pub type PCTL_ANY_SUBJECT_INFO = *mut CTL_ANY_SUBJECT_INFO; |
| 4664 |
extern "system" { |
| 4665 |
pub fn CertFindCTLInStore( |
| 4666 |
hCertStore: HCERTSTORE, |
| 4667 |
dwMsgAndCertEncodingType: DWORD, |
| 4668 |
dwFindFlags: DWORD, |
| 4669 |
dwFindType: DWORD, |
| 4670 |
pvFindPara: *const c_void, |
| 4671 |
pPrevCtlContext: PCCTL_CONTEXT, |
| 4672 |
) -> PCCTL_CONTEXT; |
| 4673 |
} |
| 4674 |
pub const CTL_FIND_ANY: DWORD = 0; |
| 4675 |
pub const CTL_FIND_SHA1_HASH: DWORD = 1; |
| 4676 |
pub const CTL_FIND_MD5_HASH: DWORD = 2; |
| 4677 |
pub const CTL_FIND_USAGE: DWORD = 3; |
| 4678 |
pub const CTL_FIND_SUBJECT: DWORD = 4; |
| 4679 |
pub const CTL_FIND_EXISTING: DWORD = 5; |
| 4680 |
STRUCT!{struct CTL_FIND_USAGE_PARA { |
| 4681 |
cbSize: DWORD, |
| 4682 |
SubjectUsage: CTL_USAGE, |
| 4683 |
ListIdentifier: CRYPT_DATA_BLOB, |
| 4684 |
pSigner: PCERT_INFO, |
| 4685 |
}} |
| 4686 |
pub type PCTL_FIND_USAGE_PARA = *mut CTL_FIND_USAGE_PARA; |
| 4687 |
pub const CTL_FIND_NO_LIST_ID_CBDATA: DWORD = 0xFFFFFFFF; |
| 4688 |
pub const CTL_FIND_NO_SIGNER_PTR: PCERT_INFO = -1isize as PCERT_INFO; |
| 4689 |
pub const CTL_FIND_SAME_USAGE_FLAG: DWORD = 0x1; |
| 4690 |
STRUCT!{struct CTL_FIND_SUBJECT_PARA { |
| 4691 |
cbSize: DWORD, |
| 4692 |
pUsagePara: PCTL_FIND_USAGE_PARA, |
| 4693 |
dwSubjectType: DWORD, |
| 4694 |
pvSubject: *mut c_void, |
| 4695 |
}} |
| 4696 |
pub type PCTL_FIND_SUBJECT_PARA = *mut CTL_FIND_SUBJECT_PARA; |
| 4697 |
extern "system" { |
| 4698 |
pub fn CertAddEncodedCTLToStore( |
| 4699 |
hCertStore: HCERTSTORE, |
| 4700 |
dwMsgAndCertEncodingType: DWORD, |
| 4701 |
pbCtlEncoded: *const BYTE, |
| 4702 |
cbCtlEncoded: DWORD, |
| 4703 |
dwAddDisposition: DWORD, |
| 4704 |
ppCtlContext: *mut PCCTL_CONTEXT, |
| 4705 |
) -> BOOL; |
| 4706 |
pub fn CertAddCTLContextToStore( |
| 4707 |
hCertStore: HCERTSTORE, |
| 4708 |
pCtlContext: PCCTL_CONTEXT, |
| 4709 |
dwAddDisposition: DWORD, |
| 4710 |
ppStoreContext: *mut PCCTL_CONTEXT, |
| 4711 |
) -> BOOL; |
| 4712 |
pub fn CertSerializeCTLStoreElement( |
| 4713 |
pCtlContext: PCCTL_CONTEXT, |
| 4714 |
dwFlags: DWORD, |
| 4715 |
pbElement: *mut BYTE, |
| 4716 |
pcbElement: *mut DWORD, |
| 4717 |
) -> BOOL; |
| 4718 |
pub fn CertDeleteCTLFromStore( |
| 4719 |
pCtlContext: PCCTL_CONTEXT, |
| 4720 |
) -> BOOL; |
| 4721 |
pub fn CertAddCertificateLinkToStore( |
| 4722 |
hCertStore: HCERTSTORE, |
| 4723 |
pCertContext: PCCERT_CONTEXT, |
| 4724 |
dwAddDisposition: DWORD, |
| 4725 |
ppStoreContext: *mut PCCERT_CONTEXT, |
| 4726 |
) -> BOOL; |
| 4727 |
pub fn CertAddCRLLinkToStore( |
| 4728 |
hCertStore: HCERTSTORE, |
| 4729 |
pCrlContext: PCCRL_CONTEXT, |
| 4730 |
dwAddDisposition: DWORD, |
| 4731 |
ppStoreContext: *mut PCCRL_CONTEXT, |
| 4732 |
) -> BOOL; |
| 4733 |
pub fn CertAddCTLLinkToStore( |
| 4734 |
hCertStore: HCERTSTORE, |
| 4735 |
pCtlContext: PCCTL_CONTEXT, |
| 4736 |
dwAddDisposition: DWORD, |
| 4737 |
ppStoreContext: *mut PCCTL_CONTEXT, |
| 4738 |
) -> BOOL; |
| 4739 |
pub fn CertAddStoreToCollection( |
| 4740 |
hCollectionStore: HCERTSTORE, |
| 4741 |
hSiblingStore: HCERTSTORE, |
| 4742 |
dwUpdateFlags: DWORD, |
| 4743 |
dwPriority: DWORD, |
| 4744 |
) -> BOOL; |
| 4745 |
pub fn CertRemoveStoreFromCollection( |
| 4746 |
hCollectionStore: HCERTSTORE, |
| 4747 |
hSiblingStore: HCERTSTORE, |
| 4748 |
); |
| 4749 |
pub fn CertControlStore( |
| 4750 |
hCertStore: HCERTSTORE, |
| 4751 |
dwFlags: DWORD, |
| 4752 |
dwCtrlType: DWORD, |
| 4753 |
pvCtrlPara: *const c_void, |
| 4754 |
) -> BOOL; |
| 4755 |
} |
| 4756 |
pub const CERT_STORE_CTRL_RESYNC: DWORD = 1; |
| 4757 |
pub const CERT_STORE_CTRL_NOTIFY_CHANGE: DWORD = 2; |
| 4758 |
pub const CERT_STORE_CTRL_COMMIT: DWORD = 3; |
| 4759 |
pub const CERT_STORE_CTRL_AUTO_RESYNC: DWORD = 4; |
| 4760 |
pub const CERT_STORE_CTRL_CANCEL_NOTIFY: DWORD = 5; |
| 4761 |
pub const CERT_STORE_CTRL_INHIBIT_DUPLICATE_HANDLE_FLAG: DWORD = 0x1; |
| 4762 |
pub const CERT_STORE_CTRL_COMMIT_FORCE_FLAG: DWORD = 0x1; |
| 4763 |
pub const CERT_STORE_CTRL_COMMIT_CLEAR_FLAG: DWORD = 0x2; |
| 4764 |
pub const CERT_STORE_LOCALIZED_NAME_PROP_ID: DWORD = 0x1000; |
| 4765 |
extern "system" { |
| 4766 |
pub fn CertSetStoreProperty( |
| 4767 |
hCertStore: HCERTSTORE, |
| 4768 |
dwPropId: DWORD, |
| 4769 |
dwFlags: DWORD, |
| 4770 |
pvData: *const c_void, |
| 4771 |
) -> BOOL; |
| 4772 |
pub fn CertGetStoreProperty( |
| 4773 |
hCertStore: HCERTSTORE, |
| 4774 |
dwPropId: DWORD, |
| 4775 |
pvData: *mut c_void, |
| 4776 |
pcbData: *mut DWORD, |
| 4777 |
) -> BOOL; |
| 4778 |
} |
| 4779 |
FN!{stdcall PFN_CERT_CREATE_CONTEXT_SORT_FUNC( |
| 4780 |
cbTotalEncoded: DWORD, |
| 4781 |
cbRemainEncoded: DWORD, |
| 4782 |
cEntry: DWORD, |
| 4783 |
pvSort: *mut c_void, |
| 4784 |
) -> BOOL} |
| 4785 |
STRUCT!{struct CERT_CREATE_CONTEXT_PARA { |
| 4786 |
cbSize: DWORD, |
| 4787 |
pfnFree: PFN_CRYPT_FREE, |
| 4788 |
pvFree: *mut c_void, |
| 4789 |
pfnSort: PFN_CERT_CREATE_CONTEXT_SORT_FUNC, |
| 4790 |
pvSort: *mut c_void, |
| 4791 |
}} |
| 4792 |
pub type PCERT_CREATE_CONTEXT_PARA = *mut CERT_CREATE_CONTEXT_PARA; |
| 4793 |
extern "system" { |
| 4794 |
pub fn CertCreateContext( |
| 4795 |
dwContextType: DWORD, |
| 4796 |
dwEncodingType: DWORD, |
| 4797 |
pbEncoded: *const BYTE, |
| 4798 |
cbEncoded: DWORD, |
| 4799 |
dwFlags: DWORD, |
| 4800 |
pCreatePara: PCERT_CREATE_CONTEXT_PARA, |
| 4801 |
) -> *const c_void; |
| 4802 |
} |
| 4803 |
pub const CERT_CREATE_CONTEXT_NOCOPY_FLAG: DWORD = 0x1; |
| 4804 |
pub const CERT_CREATE_CONTEXT_SORTED_FLAG: DWORD = 0x2; |
| 4805 |
pub const CERT_CREATE_CONTEXT_NO_HCRYPTMSG_FLAG: DWORD = 0x4; |
| 4806 |
pub const CERT_CREATE_CONTEXT_NO_ENTRY_FLAG: DWORD = 0x8; |
| 4807 |
STRUCT!{struct CERT_SYSTEM_STORE_INFO { |
| 4808 |
cbSize: DWORD, |
| 4809 |
}} |
| 4810 |
pub type PCERT_SYSTEM_STORE_INFO = *mut CERT_SYSTEM_STORE_INFO; |
| 4811 |
STRUCT!{struct CERT_PHYSICAL_STORE_INFO { |
| 4812 |
cbSize: DWORD, |
| 4813 |
pszOpenStoreProvider: LPSTR, |
| 4814 |
dwOpenEncodingType: DWORD, |
| 4815 |
dwOpenFlags: DWORD, |
| 4816 |
OpenParameters: CRYPT_DATA_BLOB, |
| 4817 |
dwFlags: DWORD, |
| 4818 |
dwPriority: DWORD, |
| 4819 |
}} |
| 4820 |
pub type PCERT_PHYSICAL_STORE_INFO = *mut CERT_PHYSICAL_STORE_INFO; |
| 4821 |
pub const CERT_PHYSICAL_STORE_ADD_ENABLE_FLAG: DWORD = 0x1; |
| 4822 |
pub const CERT_PHYSICAL_STORE_OPEN_DISABLE_FLAG: DWORD = 0x2; |
| 4823 |
pub const CERT_PHYSICAL_STORE_REMOTE_OPEN_DISABLE_FLAG: DWORD = 0x4; |
| 4824 |
pub const CERT_PHYSICAL_STORE_INSERT_COMPUTER_NAME_ENABLE_FLAG: DWORD = 0x8; |
| 4825 |
extern "system" { |
| 4826 |
pub fn CertRegisterSystemStore( |
| 4827 |
pvSystemStore: *const c_void, |
| 4828 |
dwFlags: DWORD, |
| 4829 |
pStoreInfo: PCERT_SYSTEM_STORE_INFO, |
| 4830 |
pvReserved: *mut c_void, |
| 4831 |
) -> BOOL; |
| 4832 |
pub fn CertRegisterPhysicalStore( |
| 4833 |
pvSystemStore: *const c_void, |
| 4834 |
dwFlags: DWORD, |
| 4835 |
pwszStoreName: LPCWSTR, |
| 4836 |
pStoreInfo: PCERT_PHYSICAL_STORE_INFO, |
| 4837 |
pvReserved: *mut c_void, |
| 4838 |
) -> BOOL; |
| 4839 |
pub fn CertUnregisterSystemStore( |
| 4840 |
pvSystemStore: *const c_void, |
| 4841 |
dwFlags: DWORD, |
| 4842 |
) -> BOOL; |
| 4843 |
pub fn CertUnregisterPhysicalStore( |
| 4844 |
pvSystemStore: *const c_void, |
| 4845 |
dwFlags: DWORD, |
| 4846 |
pwszStoreName: LPCWSTR, |
| 4847 |
) -> BOOL; |
| 4848 |
} |
| 4849 |
FN!{stdcall PFN_CERT_ENUM_SYSTEM_STORE_LOCATION( |
| 4850 |
pwszStoreLocation: LPCWSTR, |
| 4851 |
dwFlags: DWORD, |
| 4852 |
pvReserved: *mut c_void, |
| 4853 |
pvArg: *mut c_void, |
| 4854 |
) -> BOOL} |
| 4855 |
FN!{stdcall PFN_CERT_ENUM_SYSTEM_STORE( |
| 4856 |
pvSystemStore: *const c_void, |
| 4857 |
dwFlags: DWORD, |
| 4858 |
pStoreInfo: PCERT_SYSTEM_STORE_INFO, |
| 4859 |
pvReserved: *mut c_void, |
| 4860 |
pvArg: *mut c_void, |
| 4861 |
) -> BOOL} |
| 4862 |
FN!{stdcall PFN_CERT_ENUM_PHYSICAL_STORE( |
| 4863 |
pvSystemStore: *const c_void, |
| 4864 |
dwFlags: DWORD, |
| 4865 |
pwszStoreName: LPCWSTR, |
| 4866 |
pStoreInfo: PCERT_PHYSICAL_STORE_INFO, |
| 4867 |
pvReserved: *mut c_void, |
| 4868 |
pvArg: *mut c_void, |
| 4869 |
) -> BOOL} |
| 4870 |
pub const CERT_PHYSICAL_STORE_PREDEFINED_ENUM_FLAG: DWORD = 0x1; |
| 4871 |
pub const CERT_PHYSICAL_STORE_DEFAULT_NAME: &'static str = ".Default"; |
| 4872 |
pub const CERT_PHYSICAL_STORE_GROUP_POLICY_NAME: &'static str = ".GroupPolicy"; |
| 4873 |
pub const CERT_PHYSICAL_STORE_LOCAL_MACHINE_NAME: &'static str = ".LocalMachine"; |
| 4874 |
pub const CERT_PHYSICAL_STORE_DS_USER_CERTIFICATE_NAME: &'static str = ".UserCertificate"; |
| 4875 |
pub const CERT_PHYSICAL_STORE_LOCAL_MACHINE_GROUP_POLICY_NAME: &'static str |
| 4876 |
= ".LocalMachineGroupPolicy"; |
| 4877 |
pub const CERT_PHYSICAL_STORE_ENTERPRISE_NAME: &'static str = ".Enterprise"; |
| 4878 |
pub const CERT_PHYSICAL_STORE_AUTH_ROOT_NAME: &'static str = ".AuthRoot"; |
| 4879 |
pub const CERT_PHYSICAL_STORE_SMART_CARD_NAME: &'static str = ".SmartCard"; |
| 4880 |
extern "system" { |
| 4881 |
pub fn CertEnumSystemStoreLocation( |
| 4882 |
dwFlags: DWORD, |
| 4883 |
pvArg: *mut c_void, |
| 4884 |
pfnEnum: PFN_CERT_ENUM_SYSTEM_STORE_LOCATION, |
| 4885 |
) -> BOOL; |
| 4886 |
pub fn CertEnumSystemStore( |
| 4887 |
dwFlags: DWORD, |
| 4888 |
pvSystemStoreLocationPara: *mut c_void, |
| 4889 |
pvArg: *mut c_void, |
| 4890 |
pfnEnum: PFN_CERT_ENUM_SYSTEM_STORE, |
| 4891 |
) -> BOOL; |
| 4892 |
pub fn CertEnumPhysicalStore( |
| 4893 |
pvSystemStore: *const c_void, |
| 4894 |
dwFlags: DWORD, |
| 4895 |
pvArg: *mut c_void, |
| 4896 |
pfnEnum: PFN_CERT_ENUM_PHYSICAL_STORE, |
| 4897 |
) -> BOOL; |
| 4898 |
} |
| 4899 |
pub const CRYPT_OID_OPEN_SYSTEM_STORE_PROV_FUNC: &'static str = "CertDllOpenSystemStoreProv"; |
| 4900 |
pub const CRYPT_OID_REGISTER_SYSTEM_STORE_FUNC: &'static str = "CertDllRegisterSystemStore"; |
| 4901 |
pub const CRYPT_OID_UNREGISTER_SYSTEM_STORE_FUNC: &'static str = "CertDllUnregisterSystemStore"; |
| 4902 |
pub const CRYPT_OID_ENUM_SYSTEM_STORE_FUNC: &'static str = "CertDllEnumSystemStore"; |
| 4903 |
pub const CRYPT_OID_REGISTER_PHYSICAL_STORE_FUNC: &'static str = "CertDllRegisterPhysicalStore"; |
| 4904 |
pub const CRYPT_OID_UNREGISTER_PHYSICAL_STORE_FUNC: &'static str |
| 4905 |
= "CertDllUnregisterPhysicalStore"; |
| 4906 |
pub const CRYPT_OID_ENUM_PHYSICAL_STORE_FUNC: &'static str = "CertDllEnumPhysicalStore"; |
| 4907 |
pub const CRYPT_OID_SYSTEM_STORE_LOCATION_VALUE_NAME: &'static str = "SystemStoreLocation"; |
| 4908 |
extern "system" { |
| 4909 |
pub fn CertGetEnhancedKeyUsage( |
| 4910 |
pCertContext: PCCERT_CONTEXT, |
| 4911 |
dwFlags: DWORD, |
| 4912 |
pUsage: PCERT_ENHKEY_USAGE, |
| 4913 |
pcbUsage: *mut DWORD, |
| 4914 |
) -> BOOL; |
| 4915 |
pub fn CertSetEnhancedKeyUsage( |
| 4916 |
pCertContext: PCCERT_CONTEXT, |
| 4917 |
pUsage: PCERT_ENHKEY_USAGE, |
| 4918 |
) -> BOOL; |
| 4919 |
pub fn CertAddEnhancedKeyUsageIdentifier( |
| 4920 |
pCertContext: PCCERT_CONTEXT, |
| 4921 |
pszUsageIdentifier: LPCSTR, |
| 4922 |
) -> BOOL; |
| 4923 |
pub fn CertRemoveEnhancedKeyUsageIdentifier( |
| 4924 |
pCertContext: PCCERT_CONTEXT, |
| 4925 |
pszUsageIdentifier: LPCSTR, |
| 4926 |
) -> BOOL; |
| 4927 |
pub fn CertGetValidUsages( |
| 4928 |
cCerts: DWORD, |
| 4929 |
rghCerts: *mut PCCERT_CONTEXT, |
| 4930 |
cNumOIDs: *mut c_int, |
| 4931 |
rghOIDs: *mut LPSTR, |
| 4932 |
pcbOIDs: *mut DWORD, |
| 4933 |
) -> BOOL; |
| 4934 |
pub fn CryptMsgGetAndVerifySigner( |
| 4935 |
hCryptMsg: HCRYPTMSG, |
| 4936 |
cSignerStore: DWORD, |
| 4937 |
rghSignerStore: *mut HCERTSTORE, |
| 4938 |
dwFlags: DWORD, |
| 4939 |
ppSigner: *mut PCCERT_CONTEXT, |
| 4940 |
pdwSignerIndex: *mut DWORD, |
| 4941 |
) -> BOOL; |
| 4942 |
} |
| 4943 |
pub const CMSG_TRUSTED_SIGNER_FLAG: DWORD = 0x1; |
| 4944 |
pub const CMSG_SIGNER_ONLY_FLAG: DWORD = 0x2; |
| 4945 |
pub const CMSG_USE_SIGNER_INDEX_FLAG: DWORD = 0x4; |
| 4946 |
extern "system" { |
| 4947 |
pub fn CryptMsgSignCTL( |
| 4948 |
dwMsgEncodingType: DWORD, |
| 4949 |
pbCtlContent: *mut BYTE, |
| 4950 |
cbCtlContent: DWORD, |
| 4951 |
pSignInfo: PCMSG_SIGNED_ENCODE_INFO, |
| 4952 |
dwFlags: DWORD, |
| 4953 |
pbEncoded: *mut BYTE, |
| 4954 |
pcbEncoded: *mut DWORD, |
| 4955 |
) -> BOOL; |
| 4956 |
pub fn CryptMsgEncodeAndSignCTL( |
| 4957 |
dwMsgEncodingType: DWORD, |
| 4958 |
pCtlInfo: PCTL_INFO, |
| 4959 |
pSignInfo: PCMSG_SIGNED_ENCODE_INFO, |
| 4960 |
dwFlags: DWORD, |
| 4961 |
pbEncoded: *mut BYTE, |
| 4962 |
pcbEncoded: *mut DWORD, |
| 4963 |
) -> BOOL; |
| 4964 |
} |
| 4965 |
pub const CMSG_ENCODE_SORTED_CTL_FLAG: DWORD = 0x1; |
| 4966 |
pub const CMSG_ENCODE_HASHED_SUBJECT_IDENTIFIER_FLAG: DWORD = 0x2; |
| 4967 |
extern "system" { |
| 4968 |
pub fn CertFindSubjectInSortedCTL( |
| 4969 |
pSubjectIdentifier: PCRYPT_DATA_BLOB, |
| 4970 |
pCtlContext: PCCTL_CONTEXT, |
| 4971 |
dwFlags: DWORD, |
| 4972 |
pvReserved: *mut c_void, |
| 4973 |
pEncodedAttributes: PCRYPT_DER_BLOB, |
| 4974 |
) -> BOOL; |
| 4975 |
pub fn CertEnumSubjectInSortedCTL( |
| 4976 |
pCtlContext: PCCTL_CONTEXT, |
| 4977 |
ppvNextSubject: *mut *mut c_void, |
| 4978 |
pSubjectIdentifier: PCRYPT_DER_BLOB, |
| 4979 |
pEncodedAttributes: PCRYPT_DER_BLOB, |
| 4980 |
) -> BOOL; |
| 4981 |
} |
| 4982 |
STRUCT!{struct CTL_VERIFY_USAGE_PARA { |
| 4983 |
cbSize: DWORD, |
| 4984 |
ListIdentifier: CRYPT_DATA_BLOB, |
| 4985 |
cCtlStore: DWORD, |
| 4986 |
rghCtlStore: *mut HCERTSTORE, |
| 4987 |
cSignerStore: DWORD, |
| 4988 |
rghSignerStore: *mut HCERTSTORE, |
| 4989 |
}} |
| 4990 |
pub type PCTL_VERIFY_USAGE_PARA = *mut CTL_VERIFY_USAGE_PARA; |
| 4991 |
STRUCT!{struct CTL_VERIFY_USAGE_STATUS { |
| 4992 |
cbSize: DWORD, |
| 4993 |
dwError: DWORD, |
| 4994 |
dwFlags: DWORD, |
| 4995 |
ppCtl: *mut PCCTL_CONTEXT, |
| 4996 |
dwCtlEntryIndex: DWORD, |
| 4997 |
ppSigner: *mut PCCERT_CONTEXT, |
| 4998 |
dwSignerIndex: DWORD, |
| 4999 |
}} |
| 5000 |
pub type PCTL_VERIFY_USAGE_STATUS = *mut CTL_VERIFY_USAGE_STATUS; |
| 5001 |
pub const CERT_VERIFY_INHIBIT_CTL_UPDATE_FLAG: DWORD = 0x1; |
| 5002 |
pub const CERT_VERIFY_TRUSTED_SIGNERS_FLAG: DWORD = 0x2; |
| 5003 |
pub const CERT_VERIFY_NO_TIME_CHECK_FLAG: DWORD = 0x4; |
| 5004 |
pub const CERT_VERIFY_ALLOW_MORE_USAGE_FLAG: DWORD = 0x8; |
| 5005 |
pub const CERT_VERIFY_UPDATED_CTL_FLAG: DWORD = 0x1; |
| 5006 |
extern "system" { |
| 5007 |
pub fn CertVerifyCTLUsage( |
| 5008 |
dwEncodingType: DWORD, |
| 5009 |
dwSubjectType: DWORD, |
| 5010 |
pvSubject: *mut c_void, |
| 5011 |
pSubjectUsage: PCTL_USAGE, |
| 5012 |
dwFlags: DWORD, |
| 5013 |
pVerifyUsagePara: PCTL_VERIFY_USAGE_PARA, |
| 5014 |
pVerifyUsageStatus: PCTL_VERIFY_USAGE_STATUS, |
| 5015 |
) -> BOOL; |
| 5016 |
} |
| 5017 |
STRUCT!{struct CERT_REVOCATION_CRL_INFO { |
| 5018 |
cbSize: DWORD, |
| 5019 |
pBaseCrlContext: PCCRL_CONTEXT, |
| 5020 |
pDeltaCrlContext: PCCRL_CONTEXT, |
| 5021 |
pCrlEntry: PCRL_ENTRY, |
| 5022 |
fDeltaCrlEntry: BOOL, |
| 5023 |
}} |
| 5024 |
pub type PCERT_REVOCATION_CRL_INFO = *mut CERT_REVOCATION_CRL_INFO; |
| 5025 |
pub type PCERT_REVOCATION_CHAIN_PARA = *mut CERT_REVOCATION_CHAIN_PARA; |
| 5026 |
STRUCT!{struct CERT_REVOCATION_PARA { |
| 5027 |
cbSize: DWORD, |
| 5028 |
pIssuerCert: PCCERT_CONTEXT, |
| 5029 |
cCertStore: DWORD, |
| 5030 |
rgCertStore: *mut HCERTSTORE, |
| 5031 |
hCrlStore: HCERTSTORE, |
| 5032 |
pftTimeToUse: LPFILETIME, |
| 5033 |
dwUrlRetrievalTimeout: DWORD, |
| 5034 |
fCheckFreshnessTime: BOOL, |
| 5035 |
dwFreshnessTime: DWORD, |
| 5036 |
pftCurrentTime: LPFILETIME, |
| 5037 |
pCrlInfo: PCERT_REVOCATION_CRL_INFO, |
| 5038 |
pftCacheResync: LPFILETIME, |
| 5039 |
pChainPara: PCERT_REVOCATION_CHAIN_PARA, |
| 5040 |
}} |
| 5041 |
pub type PCERT_REVOCATION_PARA = *mut CERT_REVOCATION_PARA; |
| 5042 |
STRUCT!{struct CERT_REVOCATION_STATUS { |
| 5043 |
cbSize: DWORD, |
| 5044 |
dwIndex: DWORD, |
| 5045 |
dwError: DWORD, |
| 5046 |
dwReason: DWORD, |
| 5047 |
fHasFreshnessTime: BOOL, |
| 5048 |
dwFreshnessTime: DWORD, |
| 5049 |
}} |
| 5050 |
pub type PCERT_REVOCATION_STATUS = *mut CERT_REVOCATION_STATUS; |
| 5051 |
extern "system" { |
| 5052 |
pub fn CertVerifyRevocation( |
| 5053 |
dwEncodingType: DWORD, |
| 5054 |
dwRevType: DWORD, |
| 5055 |
cContext: DWORD, |
| 5056 |
rgpvContext: *mut PVOID, |
| 5057 |
dwFlags: DWORD, |
| 5058 |
pRevPara: PCERT_REVOCATION_PARA, |
| 5059 |
pRevStatus: PCERT_REVOCATION_STATUS, |
| 5060 |
) -> BOOL; |
| 5061 |
} |
| 5062 |
pub const CERT_CONTEXT_REVOCATION_TYPE: DWORD = 1; |
| 5063 |
pub const CERT_VERIFY_REV_CHAIN_FLAG: DWORD = 0x00000001; |
| 5064 |
pub const CERT_VERIFY_CACHE_ONLY_BASED_REVOCATION: DWORD = 0x00000002; |
| 5065 |
pub const CERT_VERIFY_REV_ACCUMULATIVE_TIMEOUT_FLAG: DWORD = 0x00000004; |
| 5066 |
pub const CERT_VERIFY_REV_SERVER_OCSP_FLAG: DWORD = 0x00000008; |
| 5067 |
pub const CERT_VERIFY_REV_NO_OCSP_FAILOVER_TO_CRL_FLAG: DWORD = 0x00000010; |
| 5068 |
extern "system" { |
| 5069 |
pub fn CertCompareIntegerBlob( |
| 5070 |
pInt1: PCRYPT_INTEGER_BLOB, |
| 5071 |
pInt2: PCRYPT_INTEGER_BLOB, |
| 5072 |
) -> BOOL; |
| 5073 |
pub fn CertCompareCertificate( |
| 5074 |
dwCertEncodingType: DWORD, |
| 5075 |
pCertId1: PCERT_INFO, |
| 5076 |
pCertId2: PCERT_INFO, |
| 5077 |
) -> BOOL; |
| 5078 |
pub fn CertCompareCertificateName( |
| 5079 |
dwCertEncodingType: DWORD, |
| 5080 |
pCertName1: PCERT_NAME_BLOB, |
| 5081 |
pCertName2: PCERT_NAME_BLOB, |
| 5082 |
) -> BOOL; |
| 5083 |
pub fn CertIsRDNAttrsInCertificateName( |
| 5084 |
dwCertEncodingType: DWORD, |
| 5085 |
dwFlags: DWORD, |
| 5086 |
pCertName: PCERT_NAME_BLOB, |
| 5087 |
pRDN: PCERT_RDN, |
| 5088 |
) -> BOOL; |
| 5089 |
pub fn CertComparePublicKeyInfo( |
| 5090 |
dwCertEncodingType: DWORD, |
| 5091 |
pPublicKey1: PCERT_PUBLIC_KEY_INFO, |
| 5092 |
pPublicKey2: PCERT_PUBLIC_KEY_INFO, |
| 5093 |
) -> BOOL; |
| 5094 |
pub fn CertGetPublicKeyLength( |
| 5095 |
dwCertEncodingType: DWORD, |
| 5096 |
pPublicKey: PCERT_PUBLIC_KEY_INFO, |
| 5097 |
) -> DWORD; |
| 5098 |
pub fn CryptVerifyCertificateSignature( |
| 5099 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5100 |
dwCertEncodingType: DWORD, |
| 5101 |
pbEncoded: *const BYTE, |
| 5102 |
cbEncoded: DWORD, |
| 5103 |
pPublicKey: PCERT_PUBLIC_KEY_INFO, |
| 5104 |
) -> BOOL; |
| 5105 |
pub fn CryptVerifyCertificateSignatureEx( |
| 5106 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5107 |
dwCertEncodingType: DWORD, |
| 5108 |
dwSubjectType: DWORD, |
| 5109 |
pvSubject: *mut c_void, |
| 5110 |
dwIssuerType: DWORD, |
| 5111 |
pvIssuer: *mut c_void, |
| 5112 |
dwFlags: DWORD, |
| 5113 |
pvExtra: *mut c_void, |
| 5114 |
) -> BOOL; |
| 5115 |
} |
| 5116 |
pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_BLOB: DWORD = 1; |
| 5117 |
pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_CERT: DWORD = 2; |
| 5118 |
pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_CRL: DWORD = 3; |
| 5119 |
pub const CRYPT_VERIFY_CERT_SIGN_SUBJECT_OCSP_BASIC_SIGNED_RESPONSE: DWORD = 4; |
| 5120 |
pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_PUBKEY: DWORD = 1; |
| 5121 |
pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_CERT: DWORD = 2; |
| 5122 |
pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_CHAIN: DWORD = 3; |
| 5123 |
pub const CRYPT_VERIFY_CERT_SIGN_ISSUER_NULL: DWORD = 4; |
| 5124 |
pub const CRYPT_VERIFY_CERT_SIGN_DISABLE_MD2_MD4_FLAG: DWORD = 0x00000001; |
| 5125 |
pub const CRYPT_VERIFY_CERT_SIGN_SET_STRONG_PROPERTIES_FLAG: DWORD = 0x00000002; |
| 5126 |
pub const CRYPT_VERIFY_CERT_SIGN_RETURN_STRONG_PROPERTIES_FLAG: DWORD = 0x00000004; |
| 5127 |
STRUCT!{struct CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO { |
| 5128 |
CertSignHashCNGAlgPropData: CRYPT_DATA_BLOB, |
| 5129 |
CertIssuerPubKeyBitLengthPropData: CRYPT_DATA_BLOB, |
| 5130 |
}} |
| 5131 |
pub type PCRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO |
| 5132 |
= *mut CRYPT_VERIFY_CERT_SIGN_STRONG_PROPERTIES_INFO; |
| 5133 |
STRUCT!{struct CRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO { |
| 5134 |
cCNGHashAlgid: DWORD, |
| 5135 |
rgpwszCNGHashAlgid: *mut PCWSTR, |
| 5136 |
dwWeakIndex: DWORD, |
| 5137 |
}} |
| 5138 |
pub type PCRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO = *mut CRYPT_VERIFY_CERT_SIGN_WEAK_HASH_INFO; |
| 5139 |
extern "system" { |
| 5140 |
pub fn CertIsStrongHashToSign( |
| 5141 |
pStrongSignPara: PCCERT_STRONG_SIGN_PARA, |
| 5142 |
pwszCNGHashAlgid: LPCWSTR, |
| 5143 |
pSigningCert: PCCERT_CONTEXT, |
| 5144 |
) -> BOOL; |
| 5145 |
pub fn CryptHashToBeSigned( |
| 5146 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5147 |
dwCertEncodingType: DWORD, |
| 5148 |
pbEncoded: *const BYTE, |
| 5149 |
cbEncoded: DWORD, |
| 5150 |
pbComputedHash: *mut BYTE, |
| 5151 |
pcbComputedHash: *mut DWORD, |
| 5152 |
) -> BOOL; |
| 5153 |
pub fn CryptHashCertificate( |
| 5154 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5155 |
Algid: ALG_ID, |
| 5156 |
dwFlags: DWORD, |
| 5157 |
pbEncoded: *const BYTE, |
| 5158 |
cbEncoded: DWORD, |
| 5159 |
pbComputedHash: *mut BYTE, |
| 5160 |
pcbComputedHash: *mut DWORD, |
| 5161 |
) -> BOOL; |
| 5162 |
pub fn CryptHashCertificate2( |
| 5163 |
pwszCNGHashAlgid: LPCWSTR, |
| 5164 |
dwFlags: DWORD, |
| 5165 |
pvReserved: *mut c_void, |
| 5166 |
pbEncoded: *const BYTE, |
| 5167 |
cbEncoded: DWORD, |
| 5168 |
pbComputedHash: *mut BYTE, |
| 5169 |
pcbComputedHash: *mut DWORD, |
| 5170 |
) -> BOOL; |
| 5171 |
pub fn CryptSignCertificate( |
| 5172 |
hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, |
| 5173 |
dwKeySpec: DWORD, |
| 5174 |
dwCertEncodingType: DWORD, |
| 5175 |
pbEncodedToBeSigned: *const BYTE, |
| 5176 |
cbEncodedToBeSigned: DWORD, |
| 5177 |
pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 5178 |
pvHashAuxInfo: *const c_void, |
| 5179 |
pbSignature: *mut BYTE, |
| 5180 |
pcbSignature: *mut DWORD, |
| 5181 |
) -> BOOL; |
| 5182 |
pub fn CryptSignAndEncodeCertificate( |
| 5183 |
hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, |
| 5184 |
dwKeySpec: DWORD, |
| 5185 |
dwCertEncodingType: DWORD, |
| 5186 |
lpszStructType: LPCSTR, |
| 5187 |
pvStructInfo: *const c_void, |
| 5188 |
pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 5189 |
pvHashAuxInfo: *const c_void, |
| 5190 |
pbEncoded: *mut BYTE, |
| 5191 |
pcbEncoded: *mut DWORD, |
| 5192 |
) -> BOOL; |
| 5193 |
} |
| 5194 |
pub const CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC: &'static str |
| 5195 |
= "CryptDllExtractEncodedSignatureParameters"; |
| 5196 |
FN!{stdcall PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC( |
| 5197 |
dwCertEncodingType: DWORD, |
| 5198 |
pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 5199 |
ppvDecodedSignPara: *mut *mut c_void, |
| 5200 |
ppwszCNGHashAlgid: LPWSTR, |
| 5201 |
) -> BOOL} |
| 5202 |
pub const CRYPT_OID_SIGN_AND_ENCODE_HASH_FUNC: &'static str = "CryptDllSignAndEncodeHash"; |
| 5203 |
FN!{stdcall PFN_CRYPT_SIGN_AND_ENCODE_HASH_FUNC( |
| 5204 |
hKey: NCRYPT_KEY_HANDLE, |
| 5205 |
dwCertEncodingType: DWORD, |
| 5206 |
pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 5207 |
pvDecodedSignPara: *mut c_void, |
| 5208 |
pwszCNGPubKeyAlgid: LPCWSTR, |
| 5209 |
pwszCNGHashAlgid: LPCWSTR, |
| 5210 |
pbComputedHash: *mut BYTE, |
| 5211 |
cbComputedHash: DWORD, |
| 5212 |
pbSignature: *mut BYTE, |
| 5213 |
pcbSignature: *mut DWORD, |
| 5214 |
) -> BOOL} |
| 5215 |
pub const CRYPT_OID_VERIFY_ENCODED_SIGNATURE_FUNC: &'static str = "CryptDllVerifyEncodedSignature"; |
| 5216 |
FN!{stdcall PFN_CRYPT_VERIFY_ENCODED_SIGNATURE_FUNC( |
| 5217 |
dwCertEncodingType: DWORD, |
| 5218 |
pPubKeyInfo: PCERT_PUBLIC_KEY_INFO, |
| 5219 |
pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 5220 |
pvDecodedSignPara: *mut c_void, |
| 5221 |
pwszCNGPubKeyAlgid: LPCWSTR, |
| 5222 |
pwszCNGHashAlgid: LPCWSTR, |
| 5223 |
pbComputedHash: *mut BYTE, |
| 5224 |
cbComputedHash: DWORD, |
| 5225 |
pbSignature: *mut BYTE, |
| 5226 |
cbSignature: DWORD, |
| 5227 |
) -> BOOL} |
| 5228 |
extern "system" { |
| 5229 |
pub fn CertVerifyTimeValidity( |
| 5230 |
pTimeToVerify: LPFILETIME, |
| 5231 |
pCertInfo: PCERT_INFO, |
| 5232 |
) -> LONG; |
| 5233 |
pub fn CertVerifyCRLTimeValidity( |
| 5234 |
pTimeToVerify: LPFILETIME, |
| 5235 |
pCrlInfo: PCRL_INFO, |
| 5236 |
) -> LONG; |
| 5237 |
pub fn CertVerifyValidityNesting( |
| 5238 |
pSubjectInfo: PCERT_INFO, |
| 5239 |
pIssuerInfo: PCERT_INFO, |
| 5240 |
) -> BOOL; |
| 5241 |
pub fn CertVerifyCRLRevocation( |
| 5242 |
dwCertEncodingType: DWORD, |
| 5243 |
pCertId: PCERT_INFO, |
| 5244 |
cCrlInfo: DWORD, |
| 5245 |
rgpCrlInfo: *mut PCRL_INFO, |
| 5246 |
) -> BOOL; |
| 5247 |
pub fn CertAlgIdToOID( |
| 5248 |
dwAlgId: DWORD, |
| 5249 |
) -> LPCSTR; |
| 5250 |
pub fn CertOIDToAlgId( |
| 5251 |
pszObjId: LPCSTR, |
| 5252 |
) -> DWORD; |
| 5253 |
pub fn CertFindExtension( |
| 5254 |
pszObjId: LPCSTR, |
| 5255 |
cExtensions: DWORD, |
| 5256 |
rgExtensions: *mut CERT_EXTENSION, |
| 5257 |
) -> PCERT_EXTENSION; |
| 5258 |
pub fn CertFindAttribute( |
| 5259 |
pszObjId: LPCSTR, |
| 5260 |
cAttr: DWORD, |
| 5261 |
rgAttr: *mut CRYPT_ATTRIBUTE, |
| 5262 |
) -> PCRYPT_ATTRIBUTE; |
| 5263 |
pub fn CertFindRDNAttr( |
| 5264 |
pszObjId: LPCSTR, |
| 5265 |
pName: PCERT_NAME_INFO, |
| 5266 |
) -> PCERT_RDN_ATTR; |
| 5267 |
pub fn CertGetIntendedKeyUsage( |
| 5268 |
dwCertEncodingType: DWORD, |
| 5269 |
pCertInfo: PCERT_INFO, |
| 5270 |
pbKeyUsage: *mut BYTE, |
| 5271 |
cbKeyUsage: DWORD, |
| 5272 |
) -> BOOL; |
| 5273 |
} |
| 5274 |
pub type HCRYPTDEFAULTCONTEXT = *mut c_void; |
| 5275 |
extern "system" { |
| 5276 |
pub fn CryptInstallDefaultContext( |
| 5277 |
hCryptProv: HCRYPTPROV, |
| 5278 |
dwDefaultType: DWORD, |
| 5279 |
pvDefaultPara: *const c_void, |
| 5280 |
dwFlags: DWORD, |
| 5281 |
pvReserved: *mut c_void, |
| 5282 |
phDefaultContext: *mut HCRYPTDEFAULTCONTEXT, |
| 5283 |
) -> BOOL; |
| 5284 |
} |
| 5285 |
pub const CRYPT_DEFAULT_CONTEXT_AUTO_RELEASE_FLAG: DWORD = 0x00000001; |
| 5286 |
pub const CRYPT_DEFAULT_CONTEXT_PROCESS_FLAG: DWORD = 0x00000002; |
| 5287 |
pub const CRYPT_DEFAULT_CONTEXT_CERT_SIGN_OID: DWORD = 1; |
| 5288 |
pub const CRYPT_DEFAULT_CONTEXT_MULTI_CERT_SIGN_OID: DWORD = 2; |
| 5289 |
STRUCT!{struct CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA { |
| 5290 |
cOID: DWORD, |
| 5291 |
rgpszOID: *mut LPSTR, |
| 5292 |
}} |
| 5293 |
pub type PCRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA = *mut CRYPT_DEFAULT_CONTEXT_MULTI_OID_PARA; |
| 5294 |
extern "system" { |
| 5295 |
pub fn CryptUninstallDefaultContext( |
| 5296 |
hDefaultContext: HCRYPTDEFAULTCONTEXT, |
| 5297 |
dwFlags: DWORD, |
| 5298 |
pvReserved: *mut c_void, |
| 5299 |
) -> BOOL; |
| 5300 |
pub fn CryptExportPublicKeyInfo( |
| 5301 |
hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, |
| 5302 |
dwKeySpec: DWORD, |
| 5303 |
dwCertEncodingType: DWORD, |
| 5304 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5305 |
pcbInfo: *mut DWORD, |
| 5306 |
) -> BOOL; |
| 5307 |
pub fn CryptExportPublicKeyInfoEx( |
| 5308 |
hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, |
| 5309 |
dwKeySpec: DWORD, |
| 5310 |
dwCertEncodingType: DWORD, |
| 5311 |
pszPublicKeyObjId: LPSTR, |
| 5312 |
dwFlags: DWORD, |
| 5313 |
pvAuxInfo: *mut c_void, |
| 5314 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5315 |
pcbInfo: *mut DWORD, |
| 5316 |
) -> BOOL; |
| 5317 |
} |
| 5318 |
pub const CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FUNC: &'static str = "CryptDllExportPublicKeyInfoEx"; |
| 5319 |
pub const CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC: &'static str |
| 5320 |
= "CryptDllExportPublicKeyInfoEx2"; |
| 5321 |
FN!{stdcall PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_EX2_FUNC( |
| 5322 |
hNCryptKey: NCRYPT_KEY_HANDLE, |
| 5323 |
dwCertEncodingType: DWORD, |
| 5324 |
pszPublicKeyObjId: LPSTR, |
| 5325 |
dwFlags: DWORD, |
| 5326 |
pvAuxInfo: *mut c_void, |
| 5327 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5328 |
pcbInfo: *mut DWORD, |
| 5329 |
) -> BOOL} |
| 5330 |
extern "system" { |
| 5331 |
pub fn CryptExportPublicKeyInfoFromBCryptKeyHandle( |
| 5332 |
hBCryptKey: BCRYPT_KEY_HANDLE, |
| 5333 |
dwCertEncodingType: DWORD, |
| 5334 |
pszPublicKeyObjId: LPSTR, |
| 5335 |
dwFlags: DWORD, |
| 5336 |
pvAuxInfo: *mut c_void, |
| 5337 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5338 |
pcbInfo: *mut DWORD, |
| 5339 |
) -> BOOL; |
| 5340 |
} |
| 5341 |
pub const CRYPT_OID_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC: &'static str |
| 5342 |
= "CryptDllExportPublicKeyInfoFromBCryptKeyHandle"; |
| 5343 |
FN!{stdcall PFN_CRYPT_EXPORT_PUBLIC_KEY_INFO_FROM_BCRYPT_HANDLE_FUNC( |
| 5344 |
hBCryptKey: BCRYPT_KEY_HANDLE, |
| 5345 |
dwCertEncodingType: DWORD, |
| 5346 |
pszPublicKeyObjId: LPSTR, |
| 5347 |
dwFlags: DWORD, |
| 5348 |
pvAuxInfo: *mut c_void, |
| 5349 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5350 |
pcbInfo: *mut DWORD, |
| 5351 |
) -> BOOL} |
| 5352 |
extern "system" { |
| 5353 |
pub fn CryptImportPublicKeyInfo( |
| 5354 |
hCryptProv: HCRYPTPROV, |
| 5355 |
dwCertEncodingType: DWORD, |
| 5356 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5357 |
phKey: *mut HCRYPTKEY, |
| 5358 |
) -> BOOL; |
| 5359 |
} |
| 5360 |
pub const CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_FUNC: &'static str = "CryptDllImportPublicKeyInfoEx"; |
| 5361 |
extern "system" { |
| 5362 |
pub fn CryptImportPublicKeyInfoEx( |
| 5363 |
hCryptProv: HCRYPTPROV, |
| 5364 |
dwCertEncodingType: DWORD, |
| 5365 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5366 |
aiKeyAlg: ALG_ID, |
| 5367 |
dwFlags: DWORD, |
| 5368 |
pvAuxInfo: *mut c_void, |
| 5369 |
phKey: *mut HCRYPTKEY, |
| 5370 |
) -> BOOL; |
| 5371 |
pub fn CryptImportPublicKeyInfoEx2( |
| 5372 |
dwCertEncodingType: DWORD, |
| 5373 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5374 |
dwFlags: DWORD, |
| 5375 |
pvAuxInfo: *mut c_void, |
| 5376 |
phKey: *mut BCRYPT_KEY_HANDLE, |
| 5377 |
) -> BOOL; |
| 5378 |
} |
| 5379 |
pub const CRYPT_OID_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC: &'static str |
| 5380 |
= "CryptDllImportPublicKeyInfoEx2"; |
| 5381 |
FN!{stdcall PFN_IMPORT_PUBLIC_KEY_INFO_EX2_FUNC( |
| 5382 |
dwCertEncodingType: DWORD, |
| 5383 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5384 |
dwFlags: DWORD, |
| 5385 |
pvAuxInfo: *mut c_void, |
| 5386 |
phKey: *mut BCRYPT_KEY_HANDLE, |
| 5387 |
) -> BOOL} |
| 5388 |
extern "system" { |
| 5389 |
pub fn CryptAcquireCertificatePrivateKey( |
| 5390 |
pCert: PCCERT_CONTEXT, |
| 5391 |
dwFlags: DWORD, |
| 5392 |
pvParameters: *mut c_void, |
| 5393 |
phCryptProvOrNCryptKey: *mut HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, |
| 5394 |
pdwKeySpec: *mut DWORD, |
| 5395 |
pfCallerFreeProvOrNCryptKey: *mut BOOL, |
| 5396 |
) -> BOOL; |
| 5397 |
} |
| 5398 |
pub const CRYPT_ACQUIRE_CACHE_FLAG: DWORD = 0x00000001; |
| 5399 |
pub const CRYPT_ACQUIRE_USE_PROV_INFO_FLAG: DWORD = 0x00000002; |
| 5400 |
pub const CRYPT_ACQUIRE_COMPARE_KEY_FLAG: DWORD = 0x00000004; |
| 5401 |
pub const CRYPT_ACQUIRE_NO_HEALING: DWORD = 0x00000008; |
| 5402 |
pub const CRYPT_ACQUIRE_SILENT_FLAG: DWORD = 0x00000040; |
| 5403 |
pub const CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG: DWORD = 0x00000080; |
| 5404 |
pub const CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK: DWORD = 0x00070000; |
| 5405 |
pub const CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG: DWORD = 0x00010000; |
| 5406 |
pub const CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG: DWORD = 0x00020000; |
| 5407 |
pub const CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG: DWORD = 0x00040000; |
| 5408 |
extern "system" { |
| 5409 |
pub fn CryptFindCertificateKeyProvInfo( |
| 5410 |
pCert: PCCERT_CONTEXT, |
| 5411 |
dwFlags: DWORD, |
| 5412 |
pvReserved: *mut c_void, |
| 5413 |
) -> BOOL; |
| 5414 |
} |
| 5415 |
pub const CRYPT_FIND_USER_KEYSET_FLAG: DWORD = 0x00000001; |
| 5416 |
pub const CRYPT_FIND_MACHINE_KEYSET_FLAG: DWORD = 0x00000002; |
| 5417 |
pub const CRYPT_FIND_SILENT_KEYSET_FLAG: DWORD = 0x00000040; |
| 5418 |
FN!{stdcall PFN_IMPORT_PRIV_KEY_FUNC( |
| 5419 |
hCryptProv: HCRYPTPROV, |
| 5420 |
pPrivateKeyInfo: *mut CRYPT_PRIVATE_KEY_INFO, |
| 5421 |
dwFlags: DWORD, |
| 5422 |
pvAuxInfo: *mut c_void, |
| 5423 |
) -> BOOL} |
| 5424 |
pub const CRYPT_OID_IMPORT_PRIVATE_KEY_INFO_FUNC: &'static str = "CryptDllImportPrivateKeyInfoEx"; |
| 5425 |
extern "system" { |
| 5426 |
pub fn CryptImportPKCS8( |
| 5427 |
sPrivateKeyAndParams: CRYPT_PKCS8_IMPORT_PARAMS, |
| 5428 |
dwFlags: DWORD, |
| 5429 |
phCryptProv: *mut HCRYPTPROV, |
| 5430 |
pvAuxInfo: *mut c_void, |
| 5431 |
) -> BOOL; |
| 5432 |
} |
| 5433 |
FN!{stdcall PFN_EXPORT_PRIV_KEY_FUNC( |
| 5434 |
hCryptProv: HCRYPTPROV, |
| 5435 |
dwKeySpec: DWORD, |
| 5436 |
pszPrivateKeyObjId: LPSTR, |
| 5437 |
dwFlags: DWORD, |
| 5438 |
pvAuxInfo: *mut c_void, |
| 5439 |
pPrivateKeyInfo: *mut CRYPT_PRIVATE_KEY_INFO, |
| 5440 |
pcbPrivateKeyInfo: *mut DWORD, |
| 5441 |
) -> BOOL} |
| 5442 |
pub const CRYPT_OID_EXPORT_PRIVATE_KEY_INFO_FUNC: &'static str = "CryptDllExportPrivateKeyInfoEx"; |
| 5443 |
pub const CRYPT_DELETE_KEYSET: DWORD = CRYPT_DELETEKEYSET; |
| 5444 |
extern "system" { |
| 5445 |
pub fn CryptExportPKCS8( |
| 5446 |
hCryptProv: HCRYPTPROV, |
| 5447 |
dwKeySpec: DWORD, |
| 5448 |
pszPrivateKeyObjId: LPSTR, |
| 5449 |
dwFlags: DWORD, |
| 5450 |
pvAuxInfo: *mut c_void, |
| 5451 |
pbPrivateKeyBlob: *mut BYTE, |
| 5452 |
pcbPrivateKeyBlob: *mut DWORD, |
| 5453 |
) -> BOOL; |
| 5454 |
pub fn CryptExportPKCS8Ex( |
| 5455 |
psExportParams: CRYPT_PKCS8_EXPORT_PARAMS, |
| 5456 |
dwKeySpec: DWORD, |
| 5457 |
pvAuxInfo: *mut c_void, |
| 5458 |
pbPrivateKeyBlob: *mut BYTE, |
| 5459 |
pcbPrivateKeyBlob: *mut DWORD, |
| 5460 |
) -> BOOL; |
| 5461 |
pub fn CryptHashPublicKeyInfo( |
| 5462 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5463 |
Algid: ALG_ID, |
| 5464 |
dwFlags: DWORD, |
| 5465 |
dwCertEncodingType: DWORD, |
| 5466 |
pInfo: PCERT_PUBLIC_KEY_INFO, |
| 5467 |
pbComputedHash: *mut BYTE, |
| 5468 |
pcbComputedHash: *mut DWORD, |
| 5469 |
) -> BOOL; |
| 5470 |
pub fn CertRDNValueToStrA( |
| 5471 |
dwValueType: DWORD, |
| 5472 |
pValue: PCERT_RDN_VALUE_BLOB, |
| 5473 |
psz: LPSTR, |
| 5474 |
csz: DWORD, |
| 5475 |
) -> DWORD; |
| 5476 |
pub fn CertRDNValueToStrW( |
| 5477 |
dwValueType: DWORD, |
| 5478 |
pValue: PCERT_RDN_VALUE_BLOB, |
| 5479 |
psz: LPWSTR, |
| 5480 |
csz: DWORD, |
| 5481 |
) -> DWORD; |
| 5482 |
pub fn CertNameToStrA( |
| 5483 |
dwCertEncodingType: DWORD, |
| 5484 |
pName: PCERT_NAME_BLOB, |
| 5485 |
dwStrType: DWORD, |
| 5486 |
psz: LPSTR, |
| 5487 |
csz: DWORD, |
| 5488 |
) -> DWORD; |
| 5489 |
pub fn CertNameToStrW( |
| 5490 |
dwCertEncodingType: DWORD, |
| 5491 |
pName: PCERT_NAME_BLOB, |
| 5492 |
dwStrType: DWORD, |
| 5493 |
psz: LPWSTR, |
| 5494 |
csz: DWORD, |
| 5495 |
) -> DWORD; |
| 5496 |
} |
| 5497 |
pub const CERT_SIMPLE_NAME_STR: DWORD = 1; |
| 5498 |
pub const CERT_OID_NAME_STR: DWORD = 2; |
| 5499 |
pub const CERT_X500_NAME_STR: DWORD = 3; |
| 5500 |
pub const CERT_XML_NAME_STR: DWORD = 4; |
| 5501 |
pub const CERT_NAME_STR_SEMICOLON_FLAG: DWORD = 0x40000000; |
| 5502 |
pub const CERT_NAME_STR_NO_PLUS_FLAG: DWORD = 0x20000000; |
| 5503 |
pub const CERT_NAME_STR_NO_QUOTING_FLAG: DWORD = 0x10000000; |
| 5504 |
pub const CERT_NAME_STR_CRLF_FLAG: DWORD = 0x08000000; |
| 5505 |
pub const CERT_NAME_STR_COMMA_FLAG: DWORD = 0x04000000; |
| 5506 |
pub const CERT_NAME_STR_REVERSE_FLAG: DWORD = 0x02000000; |
| 5507 |
pub const CERT_NAME_STR_FORWARD_FLAG: DWORD = 0x01000000; |
| 5508 |
pub const CERT_NAME_STR_DISABLE_IE4_UTF8_FLAG: DWORD = 0x00010000; |
| 5509 |
pub const CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG: DWORD = 0x00020000; |
| 5510 |
pub const CERT_NAME_STR_ENABLE_UTF8_UNICODE_FLAG: DWORD = 0x00040000; |
| 5511 |
pub const CERT_NAME_STR_FORCE_UTF8_DIR_STR_FLAG: DWORD = 0x00080000; |
| 5512 |
pub const CERT_NAME_STR_DISABLE_UTF8_DIR_STR_FLAG: DWORD = 0x00100000; |
| 5513 |
pub const CERT_NAME_STR_ENABLE_PUNYCODE_FLAG: DWORD = 0x00200000; |
| 5514 |
extern "system" { |
| 5515 |
pub fn CertStrToNameA( |
| 5516 |
dwCertEncodingType: DWORD, |
| 5517 |
pszX500: LPCSTR, |
| 5518 |
dwStrType: DWORD, |
| 5519 |
pvReserved: *mut c_void, |
| 5520 |
pbEncoded: *mut BYTE, |
| 5521 |
pcbEncoded: *mut DWORD, |
| 5522 |
ppszError: *mut LPCSTR, |
| 5523 |
) -> BOOL; |
| 5524 |
pub fn CertStrToNameW( |
| 5525 |
dwCertEncodingType: DWORD, |
| 5526 |
pszX500: LPCWSTR, |
| 5527 |
dwStrType: DWORD, |
| 5528 |
pvReserved: *mut c_void, |
| 5529 |
pbEncoded: *mut BYTE, |
| 5530 |
pcbEncoded: *mut DWORD, |
| 5531 |
ppszError: *mut LPCWSTR, |
| 5532 |
) -> BOOL; |
| 5533 |
pub fn CertGetNameStringA( |
| 5534 |
pCertContext: PCCERT_CONTEXT, |
| 5535 |
dwType: DWORD, |
| 5536 |
dwFlags: DWORD, |
| 5537 |
pvTypePara: *mut c_void, |
| 5538 |
pszNameString: LPSTR, |
| 5539 |
cchNameString: DWORD, |
| 5540 |
) -> DWORD; |
| 5541 |
pub fn CertGetNameStringW( |
| 5542 |
pCertContext: PCCERT_CONTEXT, |
| 5543 |
dwType: DWORD, |
| 5544 |
dwFlags: DWORD, |
| 5545 |
pvTypePara: *mut c_void, |
| 5546 |
pszNameString: LPWSTR, |
| 5547 |
cchNameString: DWORD, |
| 5548 |
) -> DWORD; |
| 5549 |
} |
| 5550 |
pub const CERT_NAME_EMAIL_TYPE: DWORD = 1; |
| 5551 |
pub const CERT_NAME_RDN_TYPE: DWORD = 2; |
| 5552 |
pub const CERT_NAME_ATTR_TYPE: DWORD = 3; |
| 5553 |
pub const CERT_NAME_SIMPLE_DISPLAY_TYPE: DWORD = 4; |
| 5554 |
pub const CERT_NAME_FRIENDLY_DISPLAY_TYPE: DWORD = 5; |
| 5555 |
pub const CERT_NAME_DNS_TYPE: DWORD = 6; |
| 5556 |
pub const CERT_NAME_URL_TYPE: DWORD = 7; |
| 5557 |
pub const CERT_NAME_UPN_TYPE: DWORD = 8; |
| 5558 |
pub const CERT_NAME_ISSUER_FLAG: DWORD = 0x1; |
| 5559 |
pub const CERT_NAME_DISABLE_IE4_UTF8_FLAG: DWORD = 0x00010000; |
| 5560 |
pub const CERT_NAME_SEARCH_ALL_NAMES_FLAG: DWORD = 0x2; |
| 5561 |
FN!{stdcall PFN_CRYPT_GET_SIGNER_CERTIFICATE( |
| 5562 |
pvGetArg: *mut c_void, |
| 5563 |
dwCertEncodingType: DWORD, |
| 5564 |
pSignerId: PCERT_INFO, |
| 5565 |
hMsgCertStore: HCERTSTORE, |
| 5566 |
) -> PCCERT_CONTEXT} |
| 5567 |
STRUCT!{struct CRYPT_SIGN_MESSAGE_PARA { |
| 5568 |
cbSize: DWORD, |
| 5569 |
dwMsgEncodingType: DWORD, |
| 5570 |
pSigningCert: PCCERT_CONTEXT, |
| 5571 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 5572 |
pvHashAuxInfo: *mut c_void, |
| 5573 |
cMsgCert: DWORD, |
| 5574 |
rgpMsgCert: *mut PCCERT_CONTEXT, |
| 5575 |
cMsgCrl: DWORD, |
| 5576 |
rgpMsgCrl: *mut PCCRL_CONTEXT, |
| 5577 |
cAuthAttr: DWORD, |
| 5578 |
rgAuthAttr: PCRYPT_ATTRIBUTE, |
| 5579 |
cUnauthAttr: DWORD, |
| 5580 |
rgUnauthAttr: PCRYPT_ATTRIBUTE, |
| 5581 |
dwFlags: DWORD, |
| 5582 |
dwInnerContentType: DWORD, |
| 5583 |
HashEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 5584 |
pvHashEncryptionAuxInfo: *mut c_void, |
| 5585 |
}} |
| 5586 |
pub type PCRYPT_SIGN_MESSAGE_PARA = *mut CRYPT_SIGN_MESSAGE_PARA; |
| 5587 |
pub const CRYPT_MESSAGE_BARE_CONTENT_OUT_FLAG: DWORD = 0x00000001; |
| 5588 |
pub const CRYPT_MESSAGE_ENCAPSULATED_CONTENT_OUT_FLAG: DWORD = 0x00000002; |
| 5589 |
pub const CRYPT_MESSAGE_KEYID_SIGNER_FLAG: DWORD = 0x00000004; |
| 5590 |
pub const CRYPT_MESSAGE_SILENT_KEYSET_FLAG: DWORD = 0x00000040; |
| 5591 |
STRUCT!{struct CRYPT_VERIFY_MESSAGE_PARA { |
| 5592 |
cbSize: DWORD, |
| 5593 |
dwMsgAndCertEncodingType: DWORD, |
| 5594 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5595 |
pfnGetSignerCertificate: PFN_CRYPT_GET_SIGNER_CERTIFICATE, |
| 5596 |
pvGetArg: *mut c_void, |
| 5597 |
pStrongSignPara: PCCERT_STRONG_SIGN_PARA, |
| 5598 |
}} |
| 5599 |
pub type PCRYPT_VERIFY_MESSAGE_PARA = *mut CRYPT_VERIFY_MESSAGE_PARA; |
| 5600 |
STRUCT!{struct CRYPT_ENCRYPT_MESSAGE_PARA { |
| 5601 |
cbSize: DWORD, |
| 5602 |
dwMsgEncodingType: DWORD, |
| 5603 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5604 |
ContentEncryptionAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 5605 |
pvEncryptionAuxInfo: *mut c_void, |
| 5606 |
dwFlags: DWORD, |
| 5607 |
dwInnerContentType: DWORD, |
| 5608 |
}} |
| 5609 |
pub type PCRYPT_ENCRYPT_MESSAGE_PARA = *mut CRYPT_DECRYPT_MESSAGE_PARA; |
| 5610 |
pub const CRYPT_MESSAGE_KEYID_RECIPIENT_FLAG: DWORD = 0x4; |
| 5611 |
STRUCT!{struct CRYPT_DECRYPT_MESSAGE_PARA { |
| 5612 |
cbSize: DWORD, |
| 5613 |
dwMsgAndCertEncodingType: DWORD, |
| 5614 |
cCertStore: DWORD, |
| 5615 |
rghCertStore: *mut HCERTSTORE, |
| 5616 |
dwFlags: DWORD, |
| 5617 |
}} |
| 5618 |
pub type PCRYPT_DECRYPT_MESSAGE_PARA = *mut CRYPT_DECRYPT_MESSAGE_PARA; |
| 5619 |
STRUCT!{struct CRYPT_HASH_MESSAGE_PARA { |
| 5620 |
cbSize: DWORD, |
| 5621 |
dwMsgEncodingType: DWORD, |
| 5622 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5623 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 5624 |
pvHashAuxInfo: *mut c_void, |
| 5625 |
}} |
| 5626 |
pub type PCRYPT_HASH_MESSAGE_PARA = *mut CRYPT_HASH_MESSAGE_PARA; |
| 5627 |
UNION!{union CRYPT_KEY_SIGN_MESSAGE_PARA_u { |
| 5628 |
[usize; 1], |
| 5629 |
hCryptProv hCryptProv_mut: HCRYPTPROV, |
| 5630 |
hNCryptKey hNCryptKey_mut: NCRYPT_KEY_HANDLE, |
| 5631 |
}} |
| 5632 |
STRUCT!{struct CRYPT_KEY_SIGN_MESSAGE_PARA { |
| 5633 |
cbSize: DWORD, |
| 5634 |
dwMsgAndCertEncodingType: DWORD, |
| 5635 |
u: CRYPT_KEY_SIGN_MESSAGE_PARA_u, |
| 5636 |
dwKeySpec: DWORD, |
| 5637 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 5638 |
pvHashAuxInfo: *mut c_void, |
| 5639 |
PubKeyAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 5640 |
}} |
| 5641 |
pub type PCRYPT_KEY_SIGN_MESSAGE_PARA = *mut CRYPT_KEY_SIGN_MESSAGE_PARA; |
| 5642 |
STRUCT!{struct CRYPT_KEY_VERIFY_MESSAGE_PARA { |
| 5643 |
cbSize: DWORD, |
| 5644 |
dwMsgEncodingType: DWORD, |
| 5645 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5646 |
}} |
| 5647 |
pub type PCRYPT_KEY_VERIFY_MESSAGE_PARA = *mut CRYPT_KEY_VERIFY_MESSAGE_PARA; |
| 5648 |
extern "system" { |
| 5649 |
pub fn CryptSignMessage( |
| 5650 |
pSignPara: PCRYPT_SIGN_MESSAGE_PARA, |
| 5651 |
fDetachedSignature: BOOL, |
| 5652 |
cToBeSigned: DWORD, |
| 5653 |
rgpbToBeSigned: *mut *const BYTE, |
| 5654 |
rgcbToBeSigned: *mut DWORD, |
| 5655 |
pbSignedBlob: *mut BYTE, |
| 5656 |
pcbSignedBlob: *mut DWORD, |
| 5657 |
) -> BOOL; |
| 5658 |
pub fn CryptVerifyMessageSignature( |
| 5659 |
pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, |
| 5660 |
dwSignerIndex: DWORD, |
| 5661 |
pbSignedBlob: *const BYTE, |
| 5662 |
cbSignedBlob: DWORD, |
| 5663 |
pbDecoded: *mut BYTE, |
| 5664 |
pcbDecoded: *mut DWORD, |
| 5665 |
ppSignerCert: *mut PCCERT_CONTEXT, |
| 5666 |
) -> BOOL; |
| 5667 |
pub fn CryptGetMessageSignerCount( |
| 5668 |
dwMsgEncodingType: DWORD, |
| 5669 |
pbSignedBlob: *const BYTE, |
| 5670 |
cbSignedBlob: DWORD, |
| 5671 |
) -> LONG; |
| 5672 |
pub fn CryptGetMessageCertificates( |
| 5673 |
dwMsgAndCertEncodingType: DWORD, |
| 5674 |
hCryptProv: HCRYPTPROV_LEGACY, |
| 5675 |
dwFlags: DWORD, |
| 5676 |
pbSignedBlob: *const BYTE, |
| 5677 |
cbSignedBlob: DWORD, |
| 5678 |
) -> HCERTSTORE; |
| 5679 |
pub fn CryptVerifyDetachedMessageSignature( |
| 5680 |
pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, |
| 5681 |
dwSignerIndex: DWORD, |
| 5682 |
pbDetachedSignBlob: *const BYTE, |
| 5683 |
cbDetachedSignBlob: DWORD, |
| 5684 |
cToBeSigned: DWORD, |
| 5685 |
rgpbToBeSigned: *mut *const BYTE, |
| 5686 |
rgcbToBeSigned: *mut DWORD, |
| 5687 |
ppSignerCert: *mut PCCERT_CONTEXT, |
| 5688 |
) -> BOOL; |
| 5689 |
pub fn CryptEncryptMessage( |
| 5690 |
pEncryptPara: PCRYPT_ENCRYPT_MESSAGE_PARA, |
| 5691 |
cRecipientCert: DWORD, |
| 5692 |
rgpRecipientCert: *mut PCCERT_CONTEXT, |
| 5693 |
pbToBeEncrypted: *const BYTE, |
| 5694 |
cbToBeEncrypted: DWORD, |
| 5695 |
pbEncryptedBlob: *mut BYTE, |
| 5696 |
pcbEncryptedBlob: *mut DWORD, |
| 5697 |
) -> BOOL; |
| 5698 |
pub fn CryptDecryptMessage( |
| 5699 |
pDecryptPara: PCRYPT_DECRYPT_MESSAGE_PARA, |
| 5700 |
pbEncryptedBlob: *const BYTE, |
| 5701 |
cbEncryptedBlob: DWORD, |
| 5702 |
pbDecrypted: *mut BYTE, |
| 5703 |
pcbDecrypted: *mut DWORD, |
| 5704 |
ppXchgCert: *mut PCCERT_CONTEXT, |
| 5705 |
) -> BOOL; |
| 5706 |
pub fn CryptSignAndEncryptMessage( |
| 5707 |
pSignPara: PCRYPT_SIGN_MESSAGE_PARA, |
| 5708 |
pEncryptPara: PCRYPT_ENCRYPT_MESSAGE_PARA, |
| 5709 |
cRecipientCert: DWORD, |
| 5710 |
rgpRecipientCert: *mut PCCERT_CONTEXT, |
| 5711 |
pbToBeSignedAndEncrypted: *const BYTE, |
| 5712 |
cbToBeSignedAndEncrypted: DWORD, |
| 5713 |
pbSignedAndEncryptedBlob: *mut BYTE, |
| 5714 |
pcbSignedAndEncryptedBlob: *mut DWORD, |
| 5715 |
) -> BOOL; |
| 5716 |
pub fn CryptDecryptAndVerifyMessageSignature( |
| 5717 |
pDecryptPara: PCRYPT_DECRYPT_MESSAGE_PARA, |
| 5718 |
pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, |
| 5719 |
dwSignerIndex: DWORD, |
| 5720 |
pbEncryptedBlob: *const BYTE, |
| 5721 |
cbEncryptedBlob: DWORD, |
| 5722 |
pbDecrypted: *mut BYTE, |
| 5723 |
pcbDecrypted: *mut DWORD, |
| 5724 |
ppXchgCert: *mut PCCERT_CONTEXT, |
| 5725 |
ppSignerCert: *mut PCCERT_CONTEXT, |
| 5726 |
) -> BOOL; |
| 5727 |
pub fn CryptDecodeMessage( |
| 5728 |
dwMsgTypeFlags: DWORD, |
| 5729 |
pDecryptPara: PCRYPT_DECRYPT_MESSAGE_PARA, |
| 5730 |
pVerifyPara: PCRYPT_VERIFY_MESSAGE_PARA, |
| 5731 |
dwSignerIndex: DWORD, |
| 5732 |
pbEncodedBlob: *const BYTE, |
| 5733 |
cbEncodedBlob: DWORD, |
| 5734 |
dwPrevInnerContentType: DWORD, |
| 5735 |
pdwMsgType: *mut DWORD, |
| 5736 |
pdwInnerContentType: *mut DWORD, |
| 5737 |
pbDecoded: *mut BYTE, |
| 5738 |
pcbDecoded: *mut DWORD, |
| 5739 |
ppXchgCert: *mut PCCERT_CONTEXT, |
| 5740 |
ppSignerCert: *mut PCCERT_CONTEXT, |
| 5741 |
) -> BOOL; |
| 5742 |
pub fn CryptHashMessage( |
| 5743 |
pHashPara: PCRYPT_HASH_MESSAGE_PARA, |
| 5744 |
fDetachedHash: BOOL, |
| 5745 |
cToBeHashed: DWORD, |
| 5746 |
rgpbToBeHashed: *mut *const BYTE, |
| 5747 |
rgcbToBeHashed: *mut DWORD, |
| 5748 |
pbHashedBlob: *mut BYTE, |
| 5749 |
pcbHashedBlob: *mut DWORD, |
| 5750 |
pbComputedHash: *mut BYTE, |
| 5751 |
pcbComputedHash: *mut DWORD, |
| 5752 |
) -> BOOL; |
| 5753 |
pub fn CryptVerifyMessageHash( |
| 5754 |
pHashPara: PCRYPT_HASH_MESSAGE_PARA, |
| 5755 |
pbHashedBlob: *mut BYTE, |
| 5756 |
cbHashedBlob: DWORD, |
| 5757 |
pbToBeHashed: *mut BYTE, |
| 5758 |
pcbToBeHashed: *mut DWORD, |
| 5759 |
pbComputedHash: *mut BYTE, |
| 5760 |
pcbComputedHash: *mut DWORD, |
| 5761 |
) -> BOOL; |
| 5762 |
pub fn CryptVerifyDetachedMessageHash( |
| 5763 |
pHashPara: PCRYPT_HASH_MESSAGE_PARA, |
| 5764 |
pbDetachedHashBlob: *mut BYTE, |
| 5765 |
cbDetachedHashBlob: DWORD, |
| 5766 |
cToBeHashed: DWORD, |
| 5767 |
rgpbToBeHashed: *mut *const BYTE, |
| 5768 |
rgcbToBeHashed: *mut DWORD, |
| 5769 |
pbComputedHash: *mut BYTE, |
| 5770 |
pcbComputedHash: *mut DWORD, |
| 5771 |
) -> BOOL; |
| 5772 |
pub fn CryptSignMessageWithKey( |
| 5773 |
pSignPara: PCRYPT_KEY_SIGN_MESSAGE_PARA, |
| 5774 |
pbToBeSigned: *const BYTE, |
| 5775 |
cbToBeSigned: DWORD, |
| 5776 |
pbSignedBlob: *mut BYTE, |
| 5777 |
pcbSignedBlob: *mut DWORD, |
| 5778 |
) -> BOOL; |
| 5779 |
pub fn CryptVerifyMessageSignatureWithKey( |
| 5780 |
pVerifyPara: PCRYPT_KEY_VERIFY_MESSAGE_PARA, |
| 5781 |
pPublicKeyInfo: PCERT_PUBLIC_KEY_INFO, |
| 5782 |
pbSignedBlob: *const BYTE, |
| 5783 |
cbSignedBlob: DWORD, |
| 5784 |
pbDecoded: *mut BYTE, |
| 5785 |
pcbDecoded: *mut DWORD, |
| 5786 |
) -> BOOL; |
| 5787 |
pub fn CertOpenSystemStoreA( |
| 5788 |
hProv: HCRYPTPROV_LEGACY, |
| 5789 |
szSubsystemProtocol: LPCSTR, |
| 5790 |
) -> HCERTSTORE; |
| 5791 |
pub fn CertOpenSystemStoreW( |
| 5792 |
hProv: HCRYPTPROV_LEGACY, |
| 5793 |
szSubsystemProtocol: LPCWSTR, |
| 5794 |
) -> HCERTSTORE; |
| 5795 |
pub fn CertAddEncodedCertificateToSystemStoreA( |
| 5796 |
szCertStoreName: LPCSTR, |
| 5797 |
pbCertEncoded: *const BYTE, |
| 5798 |
cbCertEncoded: DWORD, |
| 5799 |
) -> BOOL; |
| 5800 |
pub fn CertAddEncodedCertificateToSystemStoreW( |
| 5801 |
szCertStoreName: LPCWSTR, |
| 5802 |
pbCertEncoded: *const BYTE, |
| 5803 |
cbCertEncoded: DWORD, |
| 5804 |
) -> BOOL; |
| 5805 |
} |
| 5806 |
STRUCT!{struct CERT_CHAIN { |
| 5807 |
cCerts: DWORD, |
| 5808 |
certs: PCERT_BLOB, |
| 5809 |
keyLocatorInfo: CRYPT_KEY_PROV_INFO, |
| 5810 |
}} |
| 5811 |
pub type PCERT_CHAIN = *mut CERT_CHAIN; |
| 5812 |
extern "system" { |
| 5813 |
pub fn FindCertsByIssuer( |
| 5814 |
pCertChains: PCERT_CHAIN, |
| 5815 |
pcbCertChains: *mut DWORD, |
| 5816 |
pcCertChains: *mut DWORD, |
| 5817 |
pbEncodedIssuerName: *mut BYTE, |
| 5818 |
cbEncodedIssuerName: DWORD, |
| 5819 |
pwszPurpose: LPCWSTR, |
| 5820 |
dwKeySpec: DWORD, |
| 5821 |
) -> HRESULT; |
| 5822 |
pub fn CryptQueryObject( |
| 5823 |
dwObjectType: DWORD, |
| 5824 |
pvObject: *const c_void, |
| 5825 |
dwExpectedContentTypeFlags: DWORD, |
| 5826 |
dwExpectedFormatTypeFlags: DWORD, |
| 5827 |
dwFlags: DWORD, |
| 5828 |
pdwMsgAndCertEncodingType: *mut DWORD, |
| 5829 |
pdwContentType: *mut DWORD, |
| 5830 |
pdwFormatType: *mut DWORD, |
| 5831 |
phCertStore: *mut HCERTSTORE, |
| 5832 |
phMsg: *mut HCRYPTMSG, |
| 5833 |
ppvContext: *mut *const c_void, |
| 5834 |
) -> BOOL; |
| 5835 |
} |
| 5836 |
pub const CERT_QUERY_OBJECT_FILE: DWORD = 0x00000001; |
| 5837 |
pub const CERT_QUERY_OBJECT_BLOB: DWORD = 0x00000002; |
| 5838 |
pub const CERT_QUERY_CONTENT_CERT: DWORD = 1; |
| 5839 |
pub const CERT_QUERY_CONTENT_CTL: DWORD = 2; |
| 5840 |
pub const CERT_QUERY_CONTENT_CRL: DWORD = 3; |
| 5841 |
pub const CERT_QUERY_CONTENT_SERIALIZED_STORE: DWORD = 4; |
| 5842 |
pub const CERT_QUERY_CONTENT_SERIALIZED_CERT: DWORD = 5; |
| 5843 |
pub const CERT_QUERY_CONTENT_SERIALIZED_CTL: DWORD = 6; |
| 5844 |
pub const CERT_QUERY_CONTENT_SERIALIZED_CRL: DWORD = 7; |
| 5845 |
pub const CERT_QUERY_CONTENT_PKCS7_SIGNED: DWORD = 8; |
| 5846 |
pub const CERT_QUERY_CONTENT_PKCS7_UNSIGNED: DWORD = 9; |
| 5847 |
pub const CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED: DWORD = 10; |
| 5848 |
pub const CERT_QUERY_CONTENT_PKCS10: DWORD = 11; |
| 5849 |
pub const CERT_QUERY_CONTENT_PFX: DWORD = 12; |
| 5850 |
pub const CERT_QUERY_CONTENT_CERT_PAIR: DWORD = 13; |
| 5851 |
pub const CERT_QUERY_CONTENT_PFX_AND_LOAD: DWORD = 14; |
| 5852 |
pub const CERT_QUERY_CONTENT_FLAG_CERT: DWORD = 1 << CERT_QUERY_CONTENT_CERT; |
| 5853 |
pub const CERT_QUERY_CONTENT_FLAG_CTL: DWORD = 1 << CERT_QUERY_CONTENT_CTL; |
| 5854 |
pub const CERT_QUERY_CONTENT_FLAG_CRL: DWORD = 1 << CERT_QUERY_CONTENT_CRL; |
| 5855 |
pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE: DWORD |
| 5856 |
= 1<< CERT_QUERY_CONTENT_SERIALIZED_STORE; |
| 5857 |
pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT: DWORD = 1 << CERT_QUERY_CONTENT_SERIALIZED_CERT; |
| 5858 |
pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL: DWORD = 1 << CERT_QUERY_CONTENT_SERIALIZED_CTL; |
| 5859 |
pub const CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL: DWORD = 1 << CERT_QUERY_CONTENT_SERIALIZED_CRL; |
| 5860 |
pub const CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED: DWORD = 1 << CERT_QUERY_CONTENT_PKCS7_SIGNED; |
| 5861 |
pub const CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED: DWORD = 1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED; |
| 5862 |
pub const CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED: DWORD |
| 5863 |
= 1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED; |
| 5864 |
pub const CERT_QUERY_CONTENT_FLAG_PKCS10: DWORD = 1 << CERT_QUERY_CONTENT_PKCS10; |
| 5865 |
pub const CERT_QUERY_CONTENT_FLAG_PFX: DWORD = 1 << CERT_QUERY_CONTENT_PFX; |
| 5866 |
pub const CERT_QUERY_CONTENT_FLAG_CERT_PAIR: DWORD = 1 << CERT_QUERY_CONTENT_CERT_PAIR; |
| 5867 |
pub const CERT_QUERY_CONTENT_FLAG_PFX_AND_LOAD: DWORD = 1 << CERT_QUERY_CONTENT_PFX_AND_LOAD; |
| 5868 |
pub const CERT_QUERY_CONTENT_FLAG_ALL: DWORD = CERT_QUERY_CONTENT_FLAG_CERT |
| 5869 |
| CERT_QUERY_CONTENT_FLAG_CTL | CERT_QUERY_CONTENT_FLAG_CRL |
| 5870 |
| CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT |
| 5871 |
| CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL |
| 5872 |
| CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED |
| 5873 |
| CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | CERT_QUERY_CONTENT_FLAG_PKCS10 |
| 5874 |
| CERT_QUERY_CONTENT_FLAG_PFX | CERT_QUERY_CONTENT_FLAG_CERT_PAIR; |
| 5875 |
pub const CERT_QUERY_CONTENT_FLAG_ALL_ISSUER_CERT: DWORD = CERT_QUERY_CONTENT_FLAG_CERT |
| 5876 |
| CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT |
| 5877 |
| CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED; |
| 5878 |
pub const CERT_QUERY_FORMAT_BINARY: DWORD = 1; |
| 5879 |
pub const CERT_QUERY_FORMAT_BASE64_ENCODED: DWORD = 2; |
| 5880 |
pub const CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED: DWORD = 3; |
| 5881 |
pub const CERT_QUERY_FORMAT_FLAG_BINARY: DWORD = 1 << CERT_QUERY_FORMAT_BINARY; |
| 5882 |
pub const CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED: DWORD = 1 << CERT_QUERY_FORMAT_BASE64_ENCODED; |
| 5883 |
pub const CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED: DWORD |
| 5884 |
= 1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED; |
| 5885 |
pub const CERT_QUERY_FORMAT_FLAG_ALL: DWORD = CERT_QUERY_FORMAT_FLAG_BINARY |
| 5886 |
| CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED; |
| 5887 |
extern "system" { |
| 5888 |
pub fn CryptMemAlloc( |
| 5889 |
cbSize: ULONG, |
| 5890 |
) -> LPVOID; |
| 5891 |
pub fn CryptMemRealloc( |
| 5892 |
pv: LPVOID, |
| 5893 |
cbSize: ULONG, |
| 5894 |
) -> LPVOID; |
| 5895 |
pub fn CryptMemFree( |
| 5896 |
pv: LPVOID, |
| 5897 |
); |
| 5898 |
} |
| 5899 |
pub type HCRYPTASYNC = HANDLE; |
| 5900 |
pub type PHCRYPTASYNC = *mut HANDLE; |
| 5901 |
FN!{stdcall PFN_CRYPT_ASYNC_PARAM_FREE_FUNC( |
| 5902 |
pszParamOid: LPSTR, |
| 5903 |
pvParam: LPVOID, |
| 5904 |
) -> ()} |
| 5905 |
extern "system" { |
| 5906 |
pub fn CryptCreateAsyncHandle( |
| 5907 |
dwFlags: DWORD, |
| 5908 |
phAsync: PHCRYPTASYNC, |
| 5909 |
) -> BOOL; |
| 5910 |
pub fn CryptSetAsyncParam( |
| 5911 |
hAsync: HCRYPTASYNC, |
| 5912 |
pszParamOid: LPSTR, |
| 5913 |
pvParam: LPVOID, |
| 5914 |
pfnFree: PFN_CRYPT_ASYNC_PARAM_FREE_FUNC, |
| 5915 |
) -> BOOL; |
| 5916 |
pub fn CryptGetAsyncParam( |
| 5917 |
hAsync: HCRYPTASYNC, |
| 5918 |
pszParamOid: LPSTR, |
| 5919 |
ppvParam: *mut LPVOID, |
| 5920 |
ppfnFree: *mut PFN_CRYPT_ASYNC_PARAM_FREE_FUNC, |
| 5921 |
) -> BOOL; |
| 5922 |
pub fn CryptCloseAsyncHandle( |
| 5923 |
hAsync: HCRYPTASYNC, |
| 5924 |
) -> BOOL; |
| 5925 |
} |
| 5926 |
STRUCT!{struct CRYPT_BLOB_ARRAY { |
| 5927 |
cBlob: DWORD, |
| 5928 |
rgBlob: PCRYPT_DATA_BLOB, |
| 5929 |
}} |
| 5930 |
pub type PCRYPT_BLOB_ARRAY = *mut CRYPT_BLOB_ARRAY; |
| 5931 |
STRUCT!{struct CRYPT_CREDENTIALS { |
| 5932 |
cbSize: DWORD, |
| 5933 |
pszCredentialsOid: LPCSTR, |
| 5934 |
pvCredentials: LPVOID, |
| 5935 |
}} |
| 5936 |
pub type PCRYPT_CREDENTIALS = *mut CRYPT_CREDENTIALS; |
| 5937 |
pub const CREDENTIAL_OID_PASSWORD_CREDENTIALS_A: LPCSTR = 1 as LPCSTR; |
| 5938 |
pub const CREDENTIAL_OID_PASSWORD_CREDENTIALS_W: LPCSTR = 2 as LPCSTR; |
| 5939 |
STRUCT!{struct CRYPT_PASSWORD_CREDENTIALSA { |
| 5940 |
cbSize: DWORD, |
| 5941 |
pszUsername: LPSTR, |
| 5942 |
pszPassword: LPSTR, |
| 5943 |
}} |
| 5944 |
pub type PCRYPT_PASSWORD_CREDENTIALSA = *mut CRYPT_PASSWORD_CREDENTIALSA; |
| 5945 |
STRUCT!{struct CRYPT_PASSWORD_CREDENTIALSW { |
| 5946 |
cbSize: DWORD, |
| 5947 |
pszUsername: LPWSTR, |
| 5948 |
pszPassword: LPWSTR, |
| 5949 |
}} |
| 5950 |
pub type PCRYPT_PASSWORD_CREDENTIALSW = *mut CRYPT_PASSWORD_CREDENTIALSW; |
| 5951 |
pub const SCHEME_OID_RETRIEVE_ENCODED_OBJECT_FUNC: &'static str = "SchemeDllRetrieveEncodedObject"; |
| 5952 |
pub const SCHEME_OID_RETRIEVE_ENCODED_OBJECTW_FUNC: &'static str |
| 5953 |
= "SchemeDllRetrieveEncodedObjectW"; |
| 5954 |
FN!{stdcall PFN_FREE_ENCODED_OBJECT_FUNC( |
| 5955 |
pszObjectOid: LPCSTR, |
| 5956 |
pObject: PCRYPT_BLOB_ARRAY, |
| 5957 |
pvFreeContext: LPVOID, |
| 5958 |
) -> ()} |
| 5959 |
pub const CONTEXT_OID_CREATE_OBJECT_CONTEXT_FUNC: &'static str = "ContextDllCreateObjectContext"; |
| 5960 |
pub const CONTEXT_OID_CERTIFICATE: LPCSTR = 1 as LPCSTR; |
| 5961 |
pub const CONTEXT_OID_CRL: LPCSTR = 2 as LPCSTR; |
| 5962 |
pub const CONTEXT_OID_CTL: LPCSTR = 3 as LPCSTR; |
| 5963 |
pub const CONTEXT_OID_PKCS7: LPCSTR = 4 as LPCSTR; |
| 5964 |
pub const CONTEXT_OID_CAPI2_ANY: LPCSTR = 5 as LPCSTR; |
| 5965 |
pub const CONTEXT_OID_OCSP_RESP: LPCSTR = 6 as LPCSTR; |
| 5966 |
pub const CRYPT_RETRIEVE_MULTIPLE_OBJECTS: DWORD = 0x00000001; |
| 5967 |
pub const CRYPT_CACHE_ONLY_RETRIEVAL: DWORD = 0x00000002; |
| 5968 |
pub const CRYPT_WIRE_ONLY_RETRIEVAL: DWORD = 0x00000004; |
| 5969 |
pub const CRYPT_DONT_CACHE_RESULT: DWORD = 0x00000008; |
| 5970 |
pub const CRYPT_ASYNC_RETRIEVAL: DWORD = 0x00000010; |
| 5971 |
pub const CRYPT_STICKY_CACHE_RETRIEVAL: DWORD = 0x00001000; |
| 5972 |
pub const CRYPT_LDAP_SCOPE_BASE_ONLY_RETRIEVAL: DWORD = 0x00002000; |
| 5973 |
pub const CRYPT_OFFLINE_CHECK_RETRIEVAL: DWORD = 0x00004000; |
| 5974 |
pub const CRYPT_LDAP_INSERT_ENTRY_ATTRIBUTE: DWORD = 0x00008000; |
| 5975 |
pub const CRYPT_LDAP_SIGN_RETRIEVAL: DWORD = 0x00010000; |
| 5976 |
pub const CRYPT_NO_AUTH_RETRIEVAL: DWORD = 0x00020000; |
| 5977 |
pub const CRYPT_LDAP_AREC_EXCLUSIVE_RETRIEVAL: DWORD = 0x00040000; |
| 5978 |
pub const CRYPT_AIA_RETRIEVAL: DWORD = 0x00080000; |
| 5979 |
pub const CRYPT_HTTP_POST_RETRIEVAL: DWORD = 0x00100000; |
| 5980 |
pub const CRYPT_PROXY_CACHE_RETRIEVAL: DWORD = 0x00200000; |
| 5981 |
pub const CRYPT_NOT_MODIFIED_RETRIEVAL: DWORD = 0x00400000; |
| 5982 |
pub const CRYPT_ENABLE_SSL_REVOCATION_RETRIEVAL: DWORD = 0x00800000; |
| 5983 |
pub const CRYPT_RANDOM_QUERY_STRING_RETRIEVAL: DWORD = 0x04000000; |
| 5984 |
pub const CRYPT_ENABLE_FILE_RETRIEVAL: DWORD = 0x08000000; |
| 5985 |
pub const CRYPT_CREATE_NEW_FLUSH_ENTRY: DWORD = 0x10000000; |
| 5986 |
pub const CRYPT_VERIFY_CONTEXT_SIGNATURE: DWORD = 0x00000020; |
| 5987 |
pub const CRYPT_VERIFY_DATA_HASH: DWORD = 0x00000040; |
| 5988 |
pub const CRYPT_KEEP_TIME_VALID: DWORD = 0x00000080; |
| 5989 |
pub const CRYPT_DONT_VERIFY_SIGNATURE: DWORD = 0x00000100; |
| 5990 |
pub const CRYPT_DONT_CHECK_TIME_VALIDITY: DWORD = 0x00000200; |
| 5991 |
pub const CRYPT_CHECK_FRESHNESS_TIME_VALIDITY: DWORD = 0x00000400; |
| 5992 |
pub const CRYPT_ACCUMULATIVE_TIMEOUT: DWORD = 0x00000800; |
| 5993 |
pub const CRYPT_OCSP_ONLY_RETRIEVAL: DWORD = 0x01000000; |
| 5994 |
pub const CRYPT_NO_OCSP_FAILOVER_TO_CRL_RETRIEVAL: DWORD = 0x02000000; |
| 5995 |
STRUCT!{struct CRYPTNET_URL_CACHE_PRE_FETCH_INFO { |
| 5996 |
cbSize: DWORD, |
| 5997 |
dwObjectType: DWORD, |
| 5998 |
dwError: DWORD, |
| 5999 |
dwReserved: DWORD, |
| 6000 |
ThisUpdateTime: FILETIME, |
| 6001 |
NextUpdateTime: FILETIME, |
| 6002 |
PublishTime: FILETIME, |
| 6003 |
}} |
| 6004 |
pub type PCRYPTNET_URL_CACHE_PRE_FETCH_INFO = *mut CRYPTNET_URL_CACHE_PRE_FETCH_INFO; |
| 6005 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_NONE: DWORD = 0; |
| 6006 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_BLOB: DWORD = 1; |
| 6007 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_CRL: DWORD = 2; |
| 6008 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_OCSP: DWORD = 3; |
| 6009 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_AUTOROOT_CAB: DWORD = 5; |
| 6010 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_DISALLOWED_CERT_CAB: DWORD = 6; |
| 6011 |
pub const CRYPTNET_URL_CACHE_PRE_FETCH_PIN_RULES_CAB: DWORD = 7; |
| 6012 |
STRUCT!{struct CRYPTNET_URL_CACHE_FLUSH_INFO { |
| 6013 |
cbSize: DWORD, |
| 6014 |
dwExemptSeconds: DWORD, |
| 6015 |
ExpireTime: FILETIME, |
| 6016 |
}} |
| 6017 |
pub type PCRYPTNET_URL_CACHE_FLUSH_INFO = *mut CRYPTNET_URL_CACHE_FLUSH_INFO; |
| 6018 |
pub const CRYPTNET_URL_CACHE_DEFAULT_FLUSH: DWORD = 0; |
| 6019 |
pub const CRYPTNET_URL_CACHE_DISABLE_FLUSH: DWORD = 0xFFFFFFFF; |
| 6020 |
STRUCT!{struct CRYPTNET_URL_CACHE_RESPONSE_INFO { |
| 6021 |
cbSize: DWORD, |
| 6022 |
wResponseType: WORD, |
| 6023 |
wResponseFlags: WORD, |
| 6024 |
LastModifiedTime: FILETIME, |
| 6025 |
dwMaxAge: DWORD, |
| 6026 |
pwszETag: LPCWSTR, |
| 6027 |
dwProxyId: DWORD, |
| 6028 |
}} |
| 6029 |
pub type PCRYPTNET_URL_CACHE_RESPONSE_INFO = *mut CRYPTNET_URL_CACHE_RESPONSE_INFO; |
| 6030 |
pub const CRYPTNET_URL_CACHE_RESPONSE_NONE: WORD = 0; |
| 6031 |
pub const CRYPTNET_URL_CACHE_RESPONSE_HTTP: WORD = 1; |
| 6032 |
pub const CRYPTNET_URL_CACHE_RESPONSE_VALIDATED: WORD = 0x8000; |
| 6033 |
STRUCT!{struct CRYPT_RETRIEVE_AUX_INFO { |
| 6034 |
cbSize: DWORD, |
| 6035 |
pLastSyncTime: *mut FILETIME, |
| 6036 |
dwMaxUrlRetrievalByteCount: DWORD, |
| 6037 |
pPreFetchInfo: PCRYPTNET_URL_CACHE_PRE_FETCH_INFO, |
| 6038 |
pFlushInfo: PCRYPTNET_URL_CACHE_FLUSH_INFO, |
| 6039 |
ppResponseInfo: *mut PCRYPTNET_URL_CACHE_RESPONSE_INFO, |
| 6040 |
pwszCacheFileNamePrefix: LPWSTR, |
| 6041 |
pftCacheResync: LPFILETIME, |
| 6042 |
fProxyCacheRetrieval: BOOL, |
| 6043 |
dwHttpStatusCode: DWORD, |
| 6044 |
ppwszErrorResponseHeaders: *mut LPWSTR, |
| 6045 |
ppErrorContentBlob: *mut PCRYPT_DATA_BLOB, |
| 6046 |
}} |
| 6047 |
pub type PCRYPT_RETRIEVE_AUX_INFO = *mut CRYPT_RETRIEVE_AUX_INFO; |
| 6048 |
pub const CRYPT_RETRIEVE_MAX_ERROR_CONTENT_LENGTH: DWORD = 0x1000; |
| 6049 |
extern "system" { |
| 6050 |
pub fn CryptRetrieveObjectByUrlA( |
| 6051 |
pszUrl: LPCSTR, |
| 6052 |
pszObjectOid: LPCSTR, |
| 6053 |
dwRetrievalFlags: DWORD, |
| 6054 |
dwTimeout: DWORD, |
| 6055 |
ppvObject: *mut LPVOID, |
| 6056 |
hAsyncRetrieve: HCRYPTASYNC, |
| 6057 |
pCredentials: PCRYPT_CREDENTIALS, |
| 6058 |
pvVerify: LPVOID, |
| 6059 |
pAuxInfo: PCRYPT_RETRIEVE_AUX_INFO, |
| 6060 |
) -> BOOL; |
| 6061 |
pub fn CryptRetrieveObjectByUrlW( |
| 6062 |
pszUrl: LPCWSTR, |
| 6063 |
pszObjectOid: LPCSTR, |
| 6064 |
dwRetrievalFlags: DWORD, |
| 6065 |
dwTimeout: DWORD, |
| 6066 |
ppvObject: *mut LPVOID, |
| 6067 |
hAsyncRetrieve: HCRYPTASYNC, |
| 6068 |
pCredentials: PCRYPT_CREDENTIALS, |
| 6069 |
pvVerify: LPVOID, |
| 6070 |
pAuxInfo: PCRYPT_RETRIEVE_AUX_INFO, |
| 6071 |
) -> BOOL; |
| 6072 |
} |
| 6073 |
FN!{stdcall PFN_CRYPT_CANCEL_RETRIEVAL( |
| 6074 |
dwFlags: DWORD, |
| 6075 |
pvArg: *mut c_void, |
| 6076 |
) -> BOOL} |
| 6077 |
extern "system" { |
| 6078 |
pub fn CryptInstallCancelRetrieval( |
| 6079 |
pfnCancel: PFN_CRYPT_CANCEL_RETRIEVAL, |
| 6080 |
pvArg: *const c_void, |
| 6081 |
dwFlags: DWORD, |
| 6082 |
pvReserved: *mut c_void, |
| 6083 |
) -> BOOL; |
| 6084 |
pub fn CryptUninstallCancelRetrieval( |
| 6085 |
dwFlags: DWORD, |
| 6086 |
pvReserved: *mut c_void, |
| 6087 |
) -> BOOL; |
| 6088 |
pub fn CryptCancelAsyncRetrieval( |
| 6089 |
hAsyncRetrieval: HCRYPTASYNC, |
| 6090 |
) -> BOOL; |
| 6091 |
} |
| 6092 |
pub const CRYPT_PARAM_ASYNC_RETRIEVAL_COMPLETION: LPCSTR = 1 as LPCSTR; |
| 6093 |
FN!{stdcall PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC( |
| 6094 |
pvCompletion: LPVOID, |
| 6095 |
dwCompletionCode: DWORD, |
| 6096 |
pszUrl: LPCSTR, |
| 6097 |
pszObjectOid: LPSTR, |
| 6098 |
pvObject: LPVOID, |
| 6099 |
) -> ()} |
| 6100 |
STRUCT!{struct CRYPT_ASYNC_RETRIEVAL_COMPLETION { |
| 6101 |
pfnCompletion: PFN_CRYPT_ASYNC_RETRIEVAL_COMPLETION_FUNC, |
| 6102 |
pvCompletion: LPVOID, |
| 6103 |
}} |
| 6104 |
pub type PCRYPT_ASYNC_RETRIEVAL_COMPLETION = *mut CRYPT_ASYNC_RETRIEVAL_COMPLETION; |
| 6105 |
pub const CRYPT_PARAM_CANCEL_ASYNC_RETRIEVAL: LPCSTR = 2 as LPCSTR; |
| 6106 |
FN!{stdcall PFN_CANCEL_ASYNC_RETRIEVAL_FUNC( |
| 6107 |
hAsyncRetrieve: HCRYPTASYNC, |
| 6108 |
) -> BOOL} |
| 6109 |
pub const CRYPT_GET_URL_FROM_PROPERTY: DWORD = 0x00000001; |
| 6110 |
pub const CRYPT_GET_URL_FROM_EXTENSION: DWORD = 0x00000002; |
| 6111 |
pub const CRYPT_GET_URL_FROM_UNAUTH_ATTRIBUTE: DWORD = 0x00000004; |
| 6112 |
pub const CRYPT_GET_URL_FROM_AUTH_ATTRIBUTE: DWORD = 0x00000008; |
| 6113 |
STRUCT!{struct CRYPT_URL_ARRAY { |
| 6114 |
cUrl: DWORD, |
| 6115 |
rgwszUrl: *mut LPWSTR, |
| 6116 |
}} |
| 6117 |
pub type PCRYPT_URL_ARRAY = *mut CRYPT_URL_ARRAY; |
| 6118 |
STRUCT!{struct CRYPT_URL_INFO { |
| 6119 |
cbSize: DWORD, |
| 6120 |
dwSyncDeltaTime: DWORD, |
| 6121 |
cGroup: DWORD, |
| 6122 |
rgcGroupEntry: *mut DWORD, |
| 6123 |
}} |
| 6124 |
pub type PCRYPT_URL_INFO = *mut CRYPT_URL_INFO; |
| 6125 |
extern "system" { |
| 6126 |
pub fn CryptGetObjectUrl( |
| 6127 |
pszUrlOid: LPCSTR, |
| 6128 |
pvPara: LPVOID, |
| 6129 |
dwFlags: DWORD, |
| 6130 |
pUrlArray: PCRYPT_URL_ARRAY, |
| 6131 |
pcbUrlArray: *mut DWORD, |
| 6132 |
pUrlInfo: PCRYPT_URL_INFO, |
| 6133 |
pcbUrlInfo: *mut DWORD, |
| 6134 |
pvReserved: LPVOID, |
| 6135 |
) -> BOOL; |
| 6136 |
} |
| 6137 |
pub const URL_OID_GET_OBJECT_URL_FUNC: &'static str = "UrlDllGetObjectUrl"; |
| 6138 |
pub const URL_OID_CERTIFICATE_ISSUER: LPCSTR = 1 as LPCSTR; |
| 6139 |
pub const URL_OID_CERTIFICATE_CRL_DIST_POINT: LPCSTR = 2 as LPCSTR; |
| 6140 |
pub const URL_OID_CTL_ISSUER: LPCSTR = 3 as LPCSTR; |
| 6141 |
pub const URL_OID_CTL_NEXT_UPDATE: LPCSTR = 4 as LPCSTR; |
| 6142 |
pub const URL_OID_CRL_ISSUER: LPCSTR = 5 as LPCSTR; |
| 6143 |
pub const URL_OID_CERTIFICATE_FRESHEST_CRL: LPCSTR = 6 as LPCSTR; |
| 6144 |
pub const URL_OID_CRL_FRESHEST_CRL: LPCSTR = 7 as LPCSTR; |
| 6145 |
pub const URL_OID_CROSS_CERT_DIST_POINT: LPCSTR = 8 as LPCSTR; |
| 6146 |
pub const URL_OID_CERTIFICATE_OCSP: LPCSTR = 9 as LPCSTR; |
| 6147 |
pub const URL_OID_CERTIFICATE_OCSP_AND_CRL_DIST_POINT: LPCSTR = 10 as LPCSTR; |
| 6148 |
pub const URL_OID_CERTIFICATE_CRL_DIST_POINT_AND_OCSP: LPCSTR = 11 as LPCSTR; |
| 6149 |
pub const URL_OID_CROSS_CERT_SUBJECT_INFO_ACCESS: LPCSTR = 12 as LPCSTR; |
| 6150 |
pub const URL_OID_CERTIFICATE_ONLY_OCSP: LPCSTR = 13 as LPCSTR; |
| 6151 |
STRUCT!{struct CERT_CRL_CONTEXT_PAIR { |
| 6152 |
pCertContext: PCCERT_CONTEXT, |
| 6153 |
pCrlContext: PCCRL_CONTEXT, |
| 6154 |
}} |
| 6155 |
pub type PCERT_CRL_CONTEXT_PAIR = *mut CERT_CRL_CONTEXT_PAIR; |
| 6156 |
pub type PCCERT_CRL_CONTEXT_PAIR = *const CERT_CRL_CONTEXT_PAIR; |
| 6157 |
STRUCT!{struct CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO { |
| 6158 |
cbSize: DWORD, |
| 6159 |
iDeltaCrlIndicator: c_int, |
| 6160 |
pftCacheResync: LPFILETIME, |
| 6161 |
pLastSyncTime: LPFILETIME, |
| 6162 |
pMaxAgeTime: LPFILETIME, |
| 6163 |
pChainPara: PCERT_REVOCATION_CHAIN_PARA, |
| 6164 |
pDeltaCrlIndicator: PCRYPT_INTEGER_BLOB, |
| 6165 |
}} |
| 6166 |
pub type PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO = *mut CRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO; |
| 6167 |
extern "system" { |
| 6168 |
pub fn CryptGetTimeValidObject( |
| 6169 |
pszTimeValidOid: LPCSTR, |
| 6170 |
pvPara: LPVOID, |
| 6171 |
pIssuer: PCCERT_CONTEXT, |
| 6172 |
pftValidFor: LPFILETIME, |
| 6173 |
dwFlags: DWORD, |
| 6174 |
dwTimeout: DWORD, |
| 6175 |
ppvObject: *mut LPVOID, |
| 6176 |
pCredentials: PCRYPT_CREDENTIALS, |
| 6177 |
pExtraInfo: PCRYPT_GET_TIME_VALID_OBJECT_EXTRA_INFO, |
| 6178 |
) -> BOOL; |
| 6179 |
} |
| 6180 |
pub const TIME_VALID_OID_GET_OBJECT_FUNC: &'static str = "TimeValidDllGetObject"; |
| 6181 |
pub const TIME_VALID_OID_GET_CTL: LPCSTR = 1 as LPCSTR; |
| 6182 |
pub const TIME_VALID_OID_GET_CRL: LPCSTR = 2 as LPCSTR; |
| 6183 |
pub const TIME_VALID_OID_GET_CRL_FROM_CERT: LPCSTR = 3 as LPCSTR; |
| 6184 |
pub const TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CERT: LPCSTR = 4 as LPCSTR; |
| 6185 |
pub const TIME_VALID_OID_GET_FRESHEST_CRL_FROM_CRL: LPCSTR = 5 as LPCSTR; |
| 6186 |
extern "system" { |
| 6187 |
pub fn CryptFlushTimeValidObject( |
| 6188 |
pszFlushTimeValidOid: LPCSTR, |
| 6189 |
pvPara: LPVOID, |
| 6190 |
pIssuer: PCCERT_CONTEXT, |
| 6191 |
dwFlags: DWORD, |
| 6192 |
pvReserved: LPVOID, |
| 6193 |
) -> BOOL; |
| 6194 |
} |
| 6195 |
pub const TIME_VALID_OID_FLUSH_OBJECT_FUNC: &'static str = "TimeValidDllFlushObject"; |
| 6196 |
pub const TIME_VALID_OID_FLUSH_CTL: LPCSTR = 1 as LPCSTR; |
| 6197 |
pub const TIME_VALID_OID_FLUSH_CRL: LPCSTR = 2 as LPCSTR; |
| 6198 |
pub const TIME_VALID_OID_FLUSH_CRL_FROM_CERT: LPCSTR = 3 as LPCSTR; |
| 6199 |
pub const TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CERT: LPCSTR = 4 as LPCSTR; |
| 6200 |
pub const TIME_VALID_OID_FLUSH_FRESHEST_CRL_FROM_CRL: LPCSTR = 5 as LPCSTR; |
| 6201 |
extern "system" { |
| 6202 |
pub fn CertCreateSelfSignCertificate( |
| 6203 |
hCryptProvOrNCryptKey: HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, |
| 6204 |
pSubjectIssuerBlob: PCERT_NAME_BLOB, |
| 6205 |
dwFlags: DWORD, |
| 6206 |
pKeyProvInfo: PCRYPT_KEY_PROV_INFO, |
| 6207 |
pSignatureAlgorithm: PCRYPT_ALGORITHM_IDENTIFIER, |
| 6208 |
pStartTime: PSYSTEMTIME, |
| 6209 |
pEndTime: PSYSTEMTIME, |
| 6210 |
pExtensions: PCERT_EXTENSIONS, |
| 6211 |
) -> PCCERT_CONTEXT; |
| 6212 |
} |
| 6213 |
pub const CERT_CREATE_SELFSIGN_NO_SIGN: DWORD = 1; |
| 6214 |
pub const CERT_CREATE_SELFSIGN_NO_KEY_INFO: DWORD = 2; |
| 6215 |
extern "system" { |
| 6216 |
pub fn CryptGetKeyIdentifierProperty( |
| 6217 |
pKeyIdentifier: *const CRYPT_HASH_BLOB, |
| 6218 |
dwPropId: DWORD, |
| 6219 |
dwFlags: DWORD, |
| 6220 |
pwszComputerName: LPCWSTR, |
| 6221 |
pvReserved: *mut c_void, |
| 6222 |
pvData: *mut c_void, |
| 6223 |
pcbData: *mut DWORD, |
| 6224 |
) -> BOOL; |
| 6225 |
} |
| 6226 |
pub const CRYPT_KEYID_MACHINE_FLAG: DWORD = 0x00000020; |
| 6227 |
pub const CRYPT_KEYID_ALLOC_FLAG: DWORD = 0x00008000; |
| 6228 |
extern "system" { |
| 6229 |
pub fn CryptSetKeyIdentifierProperty( |
| 6230 |
pKeyIdentifier: *const CRYPT_HASH_BLOB, |
| 6231 |
dwPropId: DWORD, |
| 6232 |
dwFlags: DWORD, |
| 6233 |
pwszComputerName: LPCWSTR, |
| 6234 |
pvReserved: *mut c_void, |
| 6235 |
pvData: *const c_void, |
| 6236 |
) -> BOOL; |
| 6237 |
} |
| 6238 |
pub const CRYPT_KEYID_DELETE_FLAG: DWORD = 0x00000010; |
| 6239 |
pub const CRYPT_KEYID_SET_NEW_FLAG: DWORD = 0x00002000; |
| 6240 |
FN!{stdcall PFN_CRYPT_ENUM_KEYID_PROP( |
| 6241 |
pKeyIdentifier: *const CRYPT_HASH_BLOB, |
| 6242 |
dwFlags: DWORD, |
| 6243 |
pvReserved: *mut c_void, |
| 6244 |
pvArg: *mut c_void, |
| 6245 |
cProp: DWORD, |
| 6246 |
rgdwPropId: *mut DWORD, |
| 6247 |
rgpvData: *mut *mut c_void, |
| 6248 |
rgcbData: *mut DWORD, |
| 6249 |
) -> BOOL} |
| 6250 |
extern "system" { |
| 6251 |
pub fn CryptEnumKeyIdentifierProperties( |
| 6252 |
pKeyIdentifier: *const CRYPT_HASH_BLOB, |
| 6253 |
dwPropId: DWORD, |
| 6254 |
dwFlags: DWORD, |
| 6255 |
pwszComputerName: LPCWSTR, |
| 6256 |
pvReserved: *mut c_void, |
| 6257 |
pvArg: *mut c_void, |
| 6258 |
pfnEnum: PFN_CRYPT_ENUM_KEYID_PROP, |
| 6259 |
) -> BOOL; |
| 6260 |
pub fn CryptCreateKeyIdentifierFromCSP( |
| 6261 |
dwCertEncodingType: DWORD, |
| 6262 |
pszPubKeyOID: LPCSTR, |
| 6263 |
pPubKeyStruc: *const PUBLICKEYSTRUC, |
| 6264 |
cbPubKeyStruc: DWORD, |
| 6265 |
dwFlags: DWORD, |
| 6266 |
pvReserved: *mut c_void, |
| 6267 |
pbHash: *mut BYTE, |
| 6268 |
pcbHash: *mut DWORD, |
| 6269 |
) -> BOOL; |
| 6270 |
} |
| 6271 |
pub const CERT_CHAIN_CONFIG_REGPATH: &'static str |
| 6272 |
= "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CertDllCreateCertificateChainEngine\\Config"; |
| 6273 |
pub const CERT_CHAIN_MAX_URL_RETRIEVAL_BYTE_COUNT_VALUE_NAME: &'static str |
| 6274 |
= "MaxUrlRetrievalByteCount"; |
| 6275 |
pub const CERT_CHAIN_MAX_URL_RETRIEVAL_BYTE_COUNT_DEFAULT: DWORD = 100 * 1024 * 1024; |
| 6276 |
pub const CERT_CHAIN_CACHE_RESYNC_FILETIME_VALUE_NAME: &'static str = "ChainCacheResyncFiletime"; |
| 6277 |
pub const CERT_CHAIN_DISABLE_MANDATORY_BASIC_CONSTRAINTS_VALUE_NAME: &'static str |
| 6278 |
= "DisableMandatoryBasicConstraints"; |
| 6279 |
pub const CERT_CHAIN_DISABLE_CA_NAME_CONSTRAINTS_VALUE_NAME: &'static str |
| 6280 |
= "DisableCANameConstraints"; |
| 6281 |
pub const CERT_CHAIN_DISABLE_UNSUPPORTED_CRITICAL_EXTENSIONS_VALUE_NAME: &'static str |
| 6282 |
= "DisableUnsupportedCriticalExtensions"; |
| 6283 |
pub const CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_VALUE_NAME: &'static str = "MaxAIAUrlCountInCert"; |
| 6284 |
pub const CERT_CHAIN_MAX_AIA_URL_COUNT_IN_CERT_DEFAULT: DWORD = 5; |
| 6285 |
pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_VALUE_NAME: &'static str |
| 6286 |
= "MaxAIAUrlRetrievalCountPerChain"; |
| 6287 |
pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_COUNT_PER_CHAIN_DEFAULT: DWORD = 3; |
| 6288 |
pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_VALUE_NAME: &'static str |
| 6289 |
= "MaxAIAUrlRetrievalByteCount"; |
| 6290 |
pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_BYTE_COUNT_DEFAULT: DWORD = 100000; |
| 6291 |
pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_VALUE_NAME: &'static str |
| 6292 |
= "MaxAIAUrlRetrievalCertCount"; |
| 6293 |
pub const CERT_CHAIN_MAX_AIA_URL_RETRIEVAL_CERT_COUNT_DEFAULT: DWORD = 10; |
| 6294 |
pub const CERT_CHAIN_OCSP_VALIDITY_SECONDS_VALUE_NAME: &'static str |
| 6295 |
= "OcspValiditySeconds"; |
| 6296 |
pub const CERT_CHAIN_OCSP_VALIDITY_SECONDS_DEFAULT: DWORD = 12 * 60 * 60; |
| 6297 |
pub const CERT_CHAIN_DISABLE_SERIAL_CHAIN_VALUE_NAME: &'static str = "DisableSerialChain"; |
| 6298 |
pub const CERT_CHAIN_SERIAL_CHAIN_LOG_FILE_NAME_VALUE_NAME: &'static str |
| 6299 |
= "SerialChainLogFileName"; |
| 6300 |
pub const CERT_CHAIN_DISABLE_SYNC_WITH_SSL_TIME_VALUE_NAME: &'static str |
| 6301 |
= "DisableSyncWithSslTime"; |
| 6302 |
pub const CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_VALUE_NAME: &'static str |
| 6303 |
= "MaxSslTimeUpdatedEventCount"; |
| 6304 |
pub const CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_DEFAULT: DWORD = 5; |
| 6305 |
pub const CERT_CHAIN_MAX_SSL_TIME_UPDATED_EVENT_COUNT_DISABLE: DWORD = 0xFFFFFFFF; |
| 6306 |
pub const CERT_CHAIN_SSL_HANDSHAKE_LOG_FILE_NAME_VALUE_NAME: &'static str |
| 6307 |
= "SslHandshakeLogFileName"; |
| 6308 |
pub const CERT_CHAIN_ENABLE_WEAK_SIGNATURE_FLAGS_VALUE_NAME: &'static str |
| 6309 |
= "EnableWeakSignatureFlags"; |
| 6310 |
pub const CERT_CHAIN_ENABLE_MD2_MD4_FLAG: DWORD = 0x00000001; |
| 6311 |
pub const CERT_CHAIN_ENABLE_WEAK_RSA_ROOT_FLAG: DWORD = 0x00000002; |
| 6312 |
pub const CERT_CHAIN_ENABLE_WEAK_LOGGING_FLAG: DWORD = 0x00000004; |
| 6313 |
pub const CERT_CHAIN_ENABLE_ONLY_WEAK_LOGGING_FLAG: DWORD = 0x00000008; |
| 6314 |
pub const CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_VALUE_NAME: &'static str = "MinRsaPubKeyBitLength"; |
| 6315 |
pub const CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DEFAULT: DWORD = 1023; |
| 6316 |
pub const CERT_CHAIN_MIN_RSA_PUB_KEY_BIT_LENGTH_DISABLE: DWORD = 0xFFFFFFFF; |
| 6317 |
pub const CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_VALUE_NAME: &'static str = "WeakRsaPubKeyTime"; |
| 6318 |
pub const CERT_CHAIN_WEAK_RSA_PUB_KEY_TIME_DEFAULT: u64 = 0x01CA8A755C6E0000; |
| 6319 |
pub const CERT_CHAIN_WEAK_SIGNATURE_LOG_DIR_VALUE_NAME: &'static str = "WeakSignatureLogDir"; |
| 6320 |
pub const CERT_CHAIN_DEFAULT_CONFIG_SUBDIR: &'static str = "Default"; |
| 6321 |
pub const CERT_CHAIN_WEAK_PREFIX_NAME: &'static str = "Weak"; |
| 6322 |
pub const CERT_CHAIN_WEAK_THIRD_PARTY_CONFIG_NAME: &'static str = "ThirdParty"; |
| 6323 |
pub const CERT_CHAIN_WEAK_ALL_CONFIG_NAME: &'static str = "Al"; |
| 6324 |
pub const CERT_CHAIN_WEAK_FLAGS_NAME: &'static str = "Flags"; |
| 6325 |
pub const CERT_CHAIN_WEAK_HYGIENE_NAME: &'static str = "Hygiene"; |
| 6326 |
pub const CERT_CHAIN_WEAK_AFTER_TIME_NAME: &'static str = "AfterTime"; |
| 6327 |
pub const CERT_CHAIN_WEAK_FILE_HASH_AFTER_TIME_NAME: &'static str = "FileHashAfterTime"; |
| 6328 |
pub const CERT_CHAIN_WEAK_TIMESTAMP_HASH_AFTER_TIME_NAME: &'static str = "TimestampHashAfterTime"; |
| 6329 |
pub const CERT_CHAIN_WEAK_MIN_BIT_LENGTH_NAME: &'static str = "MinBitLength"; |
| 6330 |
pub const CERT_CHAIN_WEAK_SHA256_ALLOW_NAME: &'static str = "Sha256Allow"; |
| 6331 |
pub const CERT_CHAIN_MIN_PUB_KEY_BIT_LENGTH_DISABLE: DWORD = 0xFFFFFFFF; |
| 6332 |
pub const CERT_CHAIN_ENABLE_WEAK_SETTINGS_FLAG: DWORD = 0x80000000; |
| 6333 |
pub const CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG: DWORD = 0x00010000; |
| 6334 |
pub const CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG: DWORD = 0x00020000; |
| 6335 |
pub const CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG: DWORD = 0x00040000; |
| 6336 |
pub const CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG: DWORD = 0x00100000; |
| 6337 |
pub const CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG: DWORD = 0x00200000; |
| 6338 |
pub const CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG: DWORD = 0x00400000; |
| 6339 |
pub const CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG: DWORD = 0x00800000; |
| 6340 |
pub const CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG: DWORD = 0x01000000; |
| 6341 |
pub const CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG: DWORD = 0x02000000; |
| 6342 |
pub const CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG: DWORD = 0x04000000; |
| 6343 |
pub const CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG: DWORD = 0x08000000; |
| 6344 |
pub const CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG: DWORD = 0x10000000; |
| 6345 |
pub const CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG: DWORD = 0x20000000; |
| 6346 |
pub const CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG: DWORD = 0x40000000; |
| 6347 |
pub const CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAG: DWORD = 0x00001000; |
| 6348 |
pub const CERT_CHAIN_DISABLE_MOTW_FILE_HASH_WEAK_FLAG: DWORD = 0x00002000; |
| 6349 |
pub const CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAG: DWORD = 0x00004000; |
| 6350 |
pub const CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_HASH_WEAK_FLAG: DWORD = 0x00008000; |
| 6351 |
pub const CERT_CHAIN_DISABLE_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_ALL_EKU_WEAK_FLAG |
| 6352 |
| CERT_CHAIN_DISABLE_SERVER_AUTH_WEAK_FLAG | CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG |
| 6353 |
| CERT_CHAIN_DISABLE_CODE_SIGNING_WEAK_FLAG | CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG |
| 6354 |
| CERT_CHAIN_DISABLE_TIMESTAMP_WEAK_FLAG | CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG; |
| 6355 |
pub const CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_FILE_HASH_WEAK_FLAG |
| 6356 |
| CERT_CHAIN_DISABLE_MOTW_FILE_HASH_WEAK_FLAG; |
| 6357 |
pub const CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAGS: DWORD |
| 6358 |
= CERT_CHAIN_DISABLE_TIMESTAMP_HASH_WEAK_FLAG |
| 6359 |
| CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_HASH_WEAK_FLAG; |
| 6360 |
pub const CERT_CHAIN_ENABLE_HYGIENE_FLAGS: DWORD = CERT_CHAIN_ENABLE_ALL_EKU_HYGIENE_FLAG |
| 6361 |
| CERT_CHAIN_ENABLE_SERVER_AUTH_HYGIENE_FLAG | CERT_CHAIN_ENABLE_CODE_SIGNING_HYGIENE_FLAG |
| 6362 |
| CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG | CERT_CHAIN_ENABLE_TIMESTAMP_HYGIENE_FLAG |
| 6363 |
| CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG; |
| 6364 |
pub const CERT_CHAIN_MOTW_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_MOTW_CODE_SIGNING_WEAK_FLAG |
| 6365 |
| CERT_CHAIN_DISABLE_MOTW_TIMESTAMP_WEAK_FLAG |
| 6366 |
| CERT_CHAIN_ENABLE_MOTW_CODE_SIGNING_HYGIENE_FLAG |
| 6367 |
| CERT_CHAIN_ENABLE_MOTW_TIMESTAMP_HYGIENE_FLAG | CERT_CHAIN_MOTW_IGNORE_AFTER_TIME_WEAK_FLAG; |
| 6368 |
pub const CERT_CHAIN_OPT_IN_WEAK_FLAGS: DWORD = CERT_CHAIN_DISABLE_OPT_IN_SERVER_AUTH_WEAK_FLAG; |
| 6369 |
pub const CERT_CHAIN_AUTO_CURRENT_USER: DWORD = 1; |
| 6370 |
pub const CERT_CHAIN_AUTO_LOCAL_MACHINE: DWORD = 2; |
| 6371 |
pub const CERT_CHAIN_AUTO_IMPERSONATED: DWORD = 3; |
| 6372 |
pub const CERT_CHAIN_AUTO_PROCESS_INFO: DWORD = 4; |
| 6373 |
pub const CERT_CHAIN_AUTO_PINRULE_INFO: DWORD = 5; |
| 6374 |
pub const CERT_CHAIN_AUTO_NETWORK_INFO: DWORD = 6; |
| 6375 |
pub const CERT_CHAIN_AUTO_SERIAL_LOCAL_MACHINE: DWORD = 7; |
| 6376 |
pub const CERT_CHAIN_AUTO_HPKP_RULE_INFO: DWORD = 8; |
| 6377 |
pub const CERT_CHAIN_AUTO_FLAGS_VALUE_NAME: &'static str = "AutoFlags"; |
| 6378 |
pub const CERT_CHAIN_AUTO_FLUSH_DISABLE_FLAG: DWORD = 0x00000001; |
| 6379 |
pub const CERT_CHAIN_AUTO_LOG_CREATE_FLAG: DWORD = 0x00000002; |
| 6380 |
pub const CERT_CHAIN_AUTO_LOG_FREE_FLAG: DWORD = 0x00000004; |
| 6381 |
pub const CERT_CHAIN_AUTO_LOG_FLUSH_FLAG: DWORD = 0x00000008; |
| 6382 |
pub const CERT_CHAIN_AUTO_LOG_FLAGS: DWORD = CERT_CHAIN_AUTO_LOG_CREATE_FLAG |
| 6383 |
| CERT_CHAIN_AUTO_LOG_FREE_FLAG | CERT_CHAIN_AUTO_LOG_FLUSH_FLAG; |
| 6384 |
pub const CERT_CHAIN_AUTO_FLUSH_FIRST_DELTA_SECONDS_VALUE_NAME: &'static str |
| 6385 |
= "AutoFlushFirstDeltaSeconds"; |
| 6386 |
pub const CERT_CHAIN_AUTO_FLUSH_FIRST_DELTA_SECONDS_DEFAULT: DWORD = 5 * 60; |
| 6387 |
pub const CERT_CHAIN_AUTO_FLUSH_NEXT_DELTA_SECONDS_VALUE_NAME: &'static str |
| 6388 |
= "AutoFlushNextDeltaSeconds"; |
| 6389 |
pub const CERT_CHAIN_AUTO_FLUSH_NEXT_DELTA_SECONDS_DEFAULT: DWORD = 30 * 60; |
| 6390 |
pub const CERT_CHAIN_AUTO_LOG_FILE_NAME_VALUE_NAME: &'static str = "AutoLogFileName"; |
| 6391 |
pub const CERT_CHAIN_DISABLE_AUTO_FLUSH_PROCESS_NAME_LIST_VALUE_NAME: &'static str |
| 6392 |
= "DisableAutoFlushProcessNameList"; |
| 6393 |
pub const CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_VALUE_NAME: &'static str |
| 6394 |
= "SrvOcspRespMinValiditySeconds"; |
| 6395 |
pub const CERT_SRV_OCSP_RESP_MIN_VALIDITY_SECONDS_DEFAULT: DWORD = 10 * 60; |
| 6396 |
pub const CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME: &'static str |
| 6397 |
= "SrvOcspRespUrlRetrievalTimeoutMilliseconds"; |
| 6398 |
pub const CERT_SRV_OCSP_RESP_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT: DWORD = 15 * 1000; |
| 6399 |
pub const CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str |
| 6400 |
= "SrvOcspRespMaxBeforeNextUpdateSeconds"; |
| 6401 |
pub const CERT_SRV_OCSP_RESP_MAX_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 4 * 60 * 60; |
| 6402 |
pub const CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str |
| 6403 |
= "SrvOcspRespMinBeforeNextUpdateSeconds"; |
| 6404 |
pub const CERT_SRV_OCSP_RESP_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 2 * 60; |
| 6405 |
pub const CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str |
| 6406 |
= "SrvOcspRespMinAfterNextUpdateSeconds"; |
| 6407 |
pub const CERT_SRV_OCSP_RESP_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 1 * 60; |
| 6408 |
pub const CERT_SRV_OCSP_RESP_MIN_SYNC_CERT_FILE_SECONDS_VALUE_NAME: &'static str |
| 6409 |
= "SrvOcspRespMinSyncCertFileSeconds"; |
| 6410 |
pub const CERT_SRV_OCSP_RESP_MIN_SYNC_CERT_FILE_SECONDS_DEFAULT: DWORD = 5; |
| 6411 |
pub const CERT_SRV_OCSP_RESP_MAX_SYNC_CERT_FILE_SECONDS_VALUE_NAME: &'static str |
| 6412 |
= "SrvOcspRespMaxSyncCertFileSeconds"; |
| 6413 |
pub const CERT_SRV_OCSP_RESP_MAX_SYNC_CERT_FILE_SECONDS_DEFAULT: DWORD = 1 * 60 * 60; |
| 6414 |
pub const CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_VALUE_NAME: &'static str |
| 6415 |
= "CryptnetMaxCachedOcspPerCrlCount"; |
| 6416 |
pub const CRYPTNET_MAX_CACHED_OCSP_PER_CRL_COUNT_DEFAULT: DWORD = 500; |
| 6417 |
pub const CRYPTNET_OCSP_AFTER_CRL_DISABLE: DWORD = 0xFFFFFFFF; |
| 6418 |
pub const CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_VALUE_NAME: &'static str |
| 6419 |
= "CryptnetDefaultFlushExemptSeconds"; |
| 6420 |
pub const CRYPTNET_URL_CACHE_DEFAULT_FLUSH_EXEMPT_SECONDS_DEFAULT: DWORD = 28 * 24 * 60 * 60; |
| 6421 |
pub const CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_VALUE_NAME: &'static str |
| 6422 |
= "CryptnetPreFetchMinMaxAgeSeconds"; |
| 6423 |
pub const CRYPTNET_PRE_FETCH_MIN_MAX_AGE_SECONDS_DEFAULT: DWORD = 1 * 60 * 60; |
| 6424 |
pub const CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_VALUE_NAME: &'static str |
| 6425 |
= "CryptnetPreFetchMaxMaxAgeSeconds"; |
| 6426 |
pub const CRYPTNET_PRE_FETCH_MAX_MAX_AGE_SECONDS_DEFAULT: DWORD = 14 * 24 * 60 * 60; |
| 6427 |
pub const CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_VALUE_NAME: &'static str |
| 6428 |
= "CryptnetPreFetchMinOcspValidityPeriodSeconds"; |
| 6429 |
pub const CRYPTNET_PRE_FETCH_MIN_OCSP_VALIDITY_PERIOD_SECONDS_DEFAULT: DWORD = 14 * 24 * 60 * 60; |
| 6430 |
pub const CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_VALUE_NAME: &'static str |
| 6431 |
= "CryptnetPreFetchAfterPublishPreFetchDivisor"; |
| 6432 |
pub const CRYPTNET_PRE_FETCH_AFTER_PUBLISH_PRE_FETCH_DIVISOR_DEFAULT: DWORD = 10; |
| 6433 |
pub const CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_VALUE_NAME: &'static str |
| 6434 |
= "CryptnetPreFetchBeforeNextUpdatePreFetchDivisor"; |
| 6435 |
pub const CRYPTNET_PRE_FETCH_BEFORE_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT: DWORD = 20; |
| 6436 |
pub const CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: |
| 6437 |
&'static str = "CryptnetPreFetchMinBeforeNextUpdatePreFetchSeconds"; |
| 6438 |
pub const CRYPTNET_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD |
| 6439 |
= 1 * 60 * 60; |
| 6440 |
pub const CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_VALUE_NAME: |
| 6441 |
&'static str = "CryptnetPreFetchValidityPeriodAfterNextUpdatePreFetchDivisor"; |
| 6442 |
pub const CRYPTNET_PRE_FETCH_VALIDITY_PERIOD_AFTER_NEXT_UPDATE_PRE_FETCH_DIVISOR_DEFAULT: DWORD |
| 6443 |
= 10; |
| 6444 |
pub const CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: |
| 6445 |
&'static str = "CryptnetPreFetchMaxAfterNextUpdatePreFetchPeriodSeconds"; |
| 6446 |
pub const CRYPTNET_PRE_FETCH_MAX_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD |
| 6447 |
= 4 * 60 * 60; |
| 6448 |
pub const CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: |
| 6449 |
&'static str = "CryptnetPreFetchMinAfterNextUpdatePreFetchPeriodSeconds"; |
| 6450 |
pub const CRYPTNET_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD |
| 6451 |
= 30 * 60; |
| 6452 |
pub const CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_VALUE_NAME: &'static str |
| 6453 |
= "CryptnetPreFetchAfterCurrentTimePreFetchPeriodSeconds"; |
| 6454 |
pub const CRYPTNET_PRE_FETCH_AFTER_CURRENT_TIME_PRE_FETCH_PERIOD_SECONDS_DEFAULT: DWORD |
| 6455 |
= 30 * 60; |
| 6456 |
pub const CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_VALUE_NAME: &'static str |
| 6457 |
= "CryptnetPreFetchTriggerPeriodSeconds"; |
| 6458 |
pub const CRYPTNET_PRE_FETCH_TRIGGER_PERIOD_SECONDS_DEFAULT: DWORD = 10 * 60; |
| 6459 |
pub const CRYPTNET_PRE_FETCH_TRIGGER_DISABLE: DWORD = 0xFFFFFFFF; |
| 6460 |
pub const CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_VALUE_NAME: &'static str |
| 6461 |
= "CryptnetPreFetchScanAfterTriggerDelaySeconds"; |
| 6462 |
pub const CRYPTNET_PRE_FETCH_SCAN_AFTER_TRIGGER_DELAY_SECONDS_DEFAULT: DWORD = 60; |
| 6463 |
pub const CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_VALUE_NAME: &'static str |
| 6464 |
= "CryptnetPreFetchRetrievalTimeoutSeconds"; |
| 6465 |
pub const CRYPTNET_PRE_FETCH_RETRIEVAL_TIMEOUT_SECONDS_DEFAULT: DWORD = 5 * 60; |
| 6466 |
pub const CRYPTNET_CRL_PRE_FETCH_CONFIG_REGPATH: &'static str |
| 6467 |
= "Software\\Microsoft\\Cryptography\\OID\\EncodingType 0\\CertDllCreateCertificateChainEngine\\Config\\CrlPreFetch"; |
| 6468 |
pub const CRYPTNET_CRL_PRE_FETCH_PROCESS_NAME_LIST_VALUE_NAME: &'static str = "ProcessNameList"; |
| 6469 |
pub const CRYPTNET_CRL_PRE_FETCH_URL_LIST_VALUE_NAME: &'static str = "PreFetchUrlList"; |
| 6470 |
pub const CRYPTNET_CRL_PRE_FETCH_DISABLE_INFORMATION_EVENTS_VALUE_NAME: &'static str |
| 6471 |
= "DisableInformationEvents"; |
| 6472 |
pub const CRYPTNET_CRL_PRE_FETCH_LOG_FILE_NAME_VALUE_NAME: &'static str = "LogFileName"; |
| 6473 |
pub const CRYPTNET_CRL_PRE_FETCH_TIMEOUT_SECONDS_VALUE_NAME: &'static str = "TimeoutSeconds"; |
| 6474 |
pub const CRYPTNET_CRL_PRE_FETCH_TIMEOUT_SECONDS_DEFAULT: DWORD = 5 * 60; |
| 6475 |
pub const CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_VALUE_NAME: &'static str = "MaxAgeSeconds"; |
| 6476 |
pub const CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_DEFAULT: DWORD = 2 * 60 * 60; |
| 6477 |
pub const CRYPTNET_CRL_PRE_FETCH_MAX_AGE_SECONDS_MIN: DWORD = 5 * 60; |
| 6478 |
pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str |
| 6479 |
= "PublishBeforeNextUpdateSeconds"; |
| 6480 |
pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 1 * 60 * 60; |
| 6481 |
pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_RANDOM_INTERVAL_SECONDS_VALUE_NAME: &'static str |
| 6482 |
= "PublishRandomIntervalSeconds"; |
| 6483 |
pub const CRYPTNET_CRL_PRE_FETCH_PUBLISH_RANDOM_INTERVAL_SECONDS_DEFAULT: DWORD = 5 * 60; |
| 6484 |
pub const CRYPTNET_CRL_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str |
| 6485 |
= "MinBeforeNextUpdateSeconds"; |
| 6486 |
pub const CRYPTNET_CRL_PRE_FETCH_MIN_BEFORE_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 5 * 60; |
| 6487 |
pub const CRYPTNET_CRL_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_SECONDS_VALUE_NAME: &'static str |
| 6488 |
= "MinAfterNextUpdateSeconds"; |
| 6489 |
pub const CRYPTNET_CRL_PRE_FETCH_MIN_AFTER_NEXT_UPDATE_SECONDS_DEFAULT: DWORD = 5 * 60; |
| 6490 |
pub const CERT_GROUP_POLICY_CHAIN_CONFIG_REGPATH: &'static str |
| 6491 |
= "Software\\Policies\\Microsoft\\SystemCertificates\\ChainEngine\\Config"; |
| 6492 |
pub const CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME: &'static str |
| 6493 |
= "ChainUrlRetrievalTimeoutMilliseconds"; |
| 6494 |
pub const CERT_CHAIN_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT: DWORD = 15 * 1000; |
| 6495 |
pub const CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_VALUE_NAME: &'static str |
| 6496 |
= "ChainRevAccumulativeUrlRetrievalTimeoutMilliseconds"; |
| 6497 |
pub const CERT_CHAIN_REV_ACCUMULATIVE_URL_RETRIEVAL_TIMEOUT_MILLISECONDS_DEFAULT: DWORD |
| 6498 |
= 20 * 1000; |
| 6499 |
pub const CERT_RETR_BEHAVIOR_INET_AUTH_VALUE_NAME: &'static str = "EnableInetUnknownAuth"; |
| 6500 |
pub const CERT_RETR_BEHAVIOR_INET_STATUS_VALUE_NAME: &'static str = "EnableInetLocal"; |
| 6501 |
pub const CERT_RETR_BEHAVIOR_FILE_VALUE_NAME: &'static str = "AllowFileUrlScheme"; |
| 6502 |
pub const CERT_RETR_BEHAVIOR_LDAP_VALUE_NAME: &'static str = "DisableLDAPSignAndEncrypt"; |
| 6503 |
pub const CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_VALUE_NAME: &'static str |
| 6504 |
= "CryptnetCachedOcspSwitchToCrlCount"; |
| 6505 |
pub const CRYPTNET_CACHED_OCSP_SWITCH_TO_CRL_COUNT_DEFAULT: DWORD = 50; |
| 6506 |
pub const CRYPTNET_CRL_BEFORE_OCSP_ENABLE: DWORD = 0xFFFFFFFF; |
| 6507 |
pub const CERT_CHAIN_DISABLE_AIA_URL_RETRIEVAL_VALUE_NAME: &'static str = "DisableAIAUrlRetrieval"; |
| 6508 |
pub const CERT_CHAIN_OPTIONS_VALUE_NAME: &'static str = "Options"; |
| 6509 |
pub const CERT_CHAIN_OPTION_DISABLE_AIA_URL_RETRIEVAL: DWORD = 0x2; |
| 6510 |
pub const CERT_CHAIN_OPTION_ENABLE_SIA_URL_RETRIEVAL: DWORD = 0x4; |
| 6511 |
pub const CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_VALUE_NAME: &'static str |
| 6512 |
= "CrossCertDownloadIntervalHours"; |
| 6513 |
pub const CERT_CHAIN_CROSS_CERT_DOWNLOAD_INTERVAL_HOURS_DEFAULT: DWORD = 24 * 7; |
| 6514 |
pub const CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_VALUE_NAME: &'static str |
| 6515 |
= "CRLValidityExtensionPeriod"; |
| 6516 |
pub const CERT_CHAIN_CRL_VALIDITY_EXT_PERIOD_HOURS_DEFAULT: DWORD = 12; |
| 6517 |
pub type HCERTCHAINENGINE = HANDLE; |
| 6518 |
pub const HCCE_CURRENT_USER: HCERTCHAINENGINE = 0 as HCERTCHAINENGINE; |
| 6519 |
pub const HCCE_LOCAL_MACHINE: HCERTCHAINENGINE = 0x1 as HCERTCHAINENGINE; |
| 6520 |
pub const HCCE_SERIAL_LOCAL_MACHINE: HCERTCHAINENGINE = 0x2 as HCERTCHAINENGINE; |
| 6521 |
pub const CERT_CHAIN_CACHE_END_CERT: DWORD = 0x00000001; |
| 6522 |
pub const CERT_CHAIN_THREAD_STORE_SYNC: DWORD = 0x00000002; |
| 6523 |
pub const CERT_CHAIN_CACHE_ONLY_URL_RETRIEVAL: DWORD = 0x00000004; |
| 6524 |
pub const CERT_CHAIN_USE_LOCAL_MACHINE_STORE: DWORD = 0x00000008; |
| 6525 |
pub const CERT_CHAIN_ENABLE_CACHE_AUTO_UPDATE: DWORD = 0x00000010; |
| 6526 |
pub const CERT_CHAIN_ENABLE_SHARE_STORE: DWORD = 0x00000020; |
| 6527 |
STRUCT!{struct CERT_CHAIN_ENGINE_CONFIG { |
| 6528 |
cbSize: DWORD, |
| 6529 |
hRestrictedRoot: HCERTSTORE, |
| 6530 |
hRestrictedTrust: HCERTSTORE, |
| 6531 |
hRestrictedOther: HCERTSTORE, |
| 6532 |
cAdditionalStore: DWORD, |
| 6533 |
rghAdditionalStore: *mut HCERTSTORE, |
| 6534 |
dwFlags: DWORD, |
| 6535 |
dwUrlRetrievalTimeout: DWORD, |
| 6536 |
MaximumCachedCertificates: DWORD, |
| 6537 |
CycleDetectionModulus: DWORD, |
| 6538 |
hExclusiveRoot: HCERTSTORE, |
| 6539 |
hExclusiveTrustedPeople: HCERTSTORE, |
| 6540 |
dwExclusiveFlags: DWORD, |
| 6541 |
}} |
| 6542 |
pub type PCERT_CHAIN_ENGINE_CONFIG = *mut CERT_CHAIN_ENGINE_CONFIG; |
| 6543 |
extern "system" { |
| 6544 |
pub fn CertCreateCertificateChainEngine( |
| 6545 |
pConfig: PCERT_CHAIN_ENGINE_CONFIG, |
| 6546 |
phChainEngine: *mut HCERTCHAINENGINE, |
| 6547 |
) -> BOOL; |
| 6548 |
pub fn CertFreeCertificateChainEngine( |
| 6549 |
hChainEngine: HCERTCHAINENGINE, |
| 6550 |
); |
| 6551 |
pub fn CertResyncCertificateChainEngine( |
| 6552 |
hChainEngine: HCERTCHAINENGINE, |
| 6553 |
) -> BOOL; |
| 6554 |
} |
| 6555 |
STRUCT!{struct CERT_TRUST_STATUS { |
| 6556 |
dwErrorStatus: DWORD, |
| 6557 |
dwInfoStatus: DWORD, |
| 6558 |
}} |
| 6559 |
pub type PCERT_TRUST_STATUS = *mut CERT_TRUST_STATUS; |
| 6560 |
pub const CERT_TRUST_NO_ERROR: DWORD = 0x00000000; |
| 6561 |
pub const CERT_TRUST_IS_NOT_TIME_VALID: DWORD = 0x00000001; |
| 6562 |
pub const CERT_TRUST_IS_NOT_TIME_NESTED: DWORD = 0x00000002; |
| 6563 |
pub const CERT_TRUST_IS_REVOKED: DWORD = 0x00000004; |
| 6564 |
pub const CERT_TRUST_IS_NOT_SIGNATURE_VALID: DWORD = 0x00000008; |
| 6565 |
pub const CERT_TRUST_IS_NOT_VALID_FOR_USAGE: DWORD = 0x00000010; |
| 6566 |
pub const CERT_TRUST_IS_UNTRUSTED_ROOT: DWORD = 0x00000020; |
| 6567 |
pub const CERT_TRUST_REVOCATION_STATUS_UNKNOWN: DWORD = 0x00000040; |
| 6568 |
pub const CERT_TRUST_IS_CYCLIC: DWORD = 0x00000080; |
| 6569 |
pub const CERT_TRUST_INVALID_EXTENSION: DWORD = 0x00000100; |
| 6570 |
pub const CERT_TRUST_INVALID_POLICY_CONSTRAINTS: DWORD = 0x00000200; |
| 6571 |
pub const CERT_TRUST_INVALID_BASIC_CONSTRAINTS: DWORD = 0x00000400; |
| 6572 |
pub const CERT_TRUST_INVALID_NAME_CONSTRAINTS: DWORD = 0x00000800; |
| 6573 |
pub const CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT: DWORD = 0x00001000; |
| 6574 |
pub const CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT: DWORD = 0x00002000; |
| 6575 |
pub const CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT: DWORD = 0x00004000; |
| 6576 |
pub const CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT: DWORD = 0x00008000; |
| 6577 |
pub const CERT_TRUST_IS_OFFLINE_REVOCATION: DWORD = 0x01000000; |
| 6578 |
pub const CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY: DWORD = 0x02000000; |
| 6579 |
pub const CERT_TRUST_IS_PARTIAL_CHAIN: DWORD = 0x00010000; |
| 6580 |
pub const CERT_TRUST_CTL_IS_NOT_TIME_VALID: DWORD = 0x00020000; |
| 6581 |
pub const CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID: DWORD = 0x00040000; |
| 6582 |
pub const CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE: DWORD = 0x00080000; |
| 6583 |
pub const CERT_TRUST_HAS_EXACT_MATCH_ISSUER: DWORD = 0x00000001; |
| 6584 |
pub const CERT_TRUST_HAS_KEY_MATCH_ISSUER: DWORD = 0x00000002; |
| 6585 |
pub const CERT_TRUST_HAS_NAME_MATCH_ISSUER: DWORD = 0x00000004; |
| 6586 |
pub const CERT_TRUST_IS_SELF_SIGNED: DWORD = 0x00000008; |
| 6587 |
pub const CERT_TRUST_AUTO_UPDATE_CA_REVOCATION: DWORD = 0x00000010; |
| 6588 |
pub const CERT_TRUST_AUTO_UPDATE_END_REVOCATION: DWORD = 0x00000020; |
| 6589 |
pub const CERT_TRUST_NO_OCSP_FAILOVER_TO_CRL: DWORD = 0x00000040; |
| 6590 |
pub const CERT_TRUST_IS_KEY_ROLLOVER: DWORD = 0x00000080; |
| 6591 |
pub const CERT_TRUST_SSL_HANDSHAKE_OCSP: DWORD = 0x00040000; |
| 6592 |
pub const CERT_TRUST_SSL_TIME_VALID_OCSP: DWORD = 0x00080000; |
| 6593 |
pub const CERT_TRUST_SSL_RECONNECT_OCSP: DWORD = 0x00100000; |
| 6594 |
pub const CERT_TRUST_HAS_PREFERRED_ISSUER: DWORD = 0x00000100; |
| 6595 |
pub const CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY: DWORD = 0x00000200; |
| 6596 |
pub const CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS: DWORD = 0x00000400; |
| 6597 |
pub const CERT_TRUST_IS_PEER_TRUSTED: DWORD = 0x00000800; |
| 6598 |
pub const CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED: DWORD = 0x00001000; |
| 6599 |
pub const CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE: DWORD = 0x00002000; |
| 6600 |
pub const CERT_TRUST_IS_CA_TRUSTED: DWORD = 0x00004000; |
| 6601 |
pub const CERT_TRUST_HAS_AUTO_UPDATE_WEAK_SIGNATURE: DWORD = 0x00008000; |
| 6602 |
pub const CERT_TRUST_HAS_ALLOW_WEAK_SIGNATURE: DWORD = 0x00020000; |
| 6603 |
pub const CERT_TRUST_IS_COMPLEX_CHAIN: DWORD = 0x00010000; |
| 6604 |
pub const CERT_TRUST_SSL_TIME_VALID: DWORD = 0x01000000; |
| 6605 |
pub const CERT_TRUST_NO_TIME_CHECK: DWORD = 0x02000000; |
| 6606 |
STRUCT!{struct CERT_REVOCATION_INFO { |
| 6607 |
cbSize: DWORD, |
| 6608 |
dwRevocationResult: DWORD, |
| 6609 |
pszRevocationOid: LPCSTR, |
| 6610 |
pvOidSpecificInfo: LPVOID, |
| 6611 |
fHasFreshnessTime: BOOL, |
| 6612 |
dwFreshnessTime: DWORD, |
| 6613 |
pCrlInfo: PCERT_REVOCATION_CRL_INFO, |
| 6614 |
}} |
| 6615 |
pub type PCERT_REVOCATION_INFO = *mut CERT_REVOCATION_INFO; |
| 6616 |
STRUCT!{struct CERT_TRUST_LIST_INFO { |
| 6617 |
cbSize: DWORD, |
| 6618 |
pCtlEntry: PCTL_ENTRY, |
| 6619 |
pCtlContext: PCCTL_CONTEXT, |
| 6620 |
}} |
| 6621 |
pub type PCERT_TRUST_LIST_INFO = *mut CERT_TRUST_LIST_INFO; |
| 6622 |
STRUCT!{struct CERT_CHAIN_ELEMENT { |
| 6623 |
cbSize: DWORD, |
| 6624 |
pCertContext: PCCERT_CONTEXT, |
| 6625 |
TrustStatus: CERT_TRUST_STATUS, |
| 6626 |
pRevocationInfo: PCERT_REVOCATION_INFO, |
| 6627 |
pIssuanceUsage: PCERT_ENHKEY_USAGE, |
| 6628 |
pApplicationUsage: PCERT_ENHKEY_USAGE, |
| 6629 |
pwszExtendedErrorInfo: LPWSTR, |
| 6630 |
}} |
| 6631 |
pub type PCERT_CHAIN_ELEMENT = *mut CERT_CHAIN_ELEMENT; |
| 6632 |
pub type PCCERT_CHAIN_ELEMENT = *const CERT_CHAIN_ELEMENT; |
| 6633 |
STRUCT!{struct CERT_SIMPLE_CHAIN { |
| 6634 |
cbSize: DWORD, |
| 6635 |
TrustStatus: CERT_TRUST_STATUS, |
| 6636 |
cElement: DWORD, |
| 6637 |
rgpElement: *mut PCERT_CHAIN_ELEMENT, |
| 6638 |
pTrustListInfo: PCERT_TRUST_LIST_INFO, |
| 6639 |
fHasRevocationFreshnessTime: BOOL, |
| 6640 |
dwRevocationFreshnessTime: DWORD, |
| 6641 |
}} |
| 6642 |
pub type PCERT_SIMPLE_CHAIN = *mut CERT_SIMPLE_CHAIN; |
| 6643 |
pub type PCCERT_SIMPLE_CHAIN = *const CERT_SIMPLE_CHAIN; |
| 6644 |
pub type PCERT_CHAIN_CONTEXT = *mut CERT_CHAIN_CONTEXT; |
| 6645 |
pub type PCCERT_CHAIN_CONTEXT = *const CERT_CHAIN_CONTEXT; |
| 6646 |
STRUCT!{struct CERT_CHAIN_CONTEXT { |
| 6647 |
cbSize: DWORD, |
| 6648 |
TrustStatus: CERT_TRUST_STATUS, |
| 6649 |
cChain: DWORD, |
| 6650 |
rgpChain: *mut PCERT_SIMPLE_CHAIN, |
| 6651 |
cLowerQualityChainContext: DWORD, |
| 6652 |
rgpLowerQualityChainContext: *mut PCCERT_CHAIN_CONTEXT, |
| 6653 |
fHasRevocationFreshnessTime: BOOL, |
| 6654 |
dwRevocationFreshnessTime: DWORD, |
| 6655 |
dwCreateFlags: DWORD, |
| 6656 |
ChainId: GUID, |
| 6657 |
}} |
| 6658 |
pub const USAGE_MATCH_TYPE_AND: DWORD = 0x00000000; |
| 6659 |
pub const USAGE_MATCH_TYPE_OR: DWORD = 0x00000001; |
| 6660 |
STRUCT!{struct CERT_USAGE_MATCH { |
| 6661 |
dwType: DWORD, |
| 6662 |
Usage: CERT_ENHKEY_USAGE, |
| 6663 |
}} |
| 6664 |
pub type PCERT_USAGE_MATCH = *mut CERT_USAGE_MATCH; |
| 6665 |
STRUCT!{struct CTL_USAGE_MATCH { |
| 6666 |
dwType: DWORD, |
| 6667 |
Usage: CTL_USAGE, |
| 6668 |
}} |
| 6669 |
pub type PCTL_USAGE_MATCH = *mut CTL_USAGE_MATCH; |
| 6670 |
STRUCT!{struct CERT_CHAIN_PARA { |
| 6671 |
cbSize: DWORD, |
| 6672 |
RequestedUsage: CERT_USAGE_MATCH, |
| 6673 |
RequestedIssuancePolicy: CERT_USAGE_MATCH, |
| 6674 |
dwUrlRetrievalTimeout: DWORD, |
| 6675 |
fCheckRevocationFreshnessTime: BOOL, |
| 6676 |
dwRevocationFreshnessTime: DWORD, |
| 6677 |
pftCacheResync: LPFILETIME, |
| 6678 |
pStrongSignPara: PCCERT_STRONG_SIGN_PARA, |
| 6679 |
dwStrongSignFlags: DWORD, |
| 6680 |
}} |
| 6681 |
pub type PCERT_CHAIN_PARA = *mut CERT_CHAIN_PARA; |
| 6682 |
pub const CERT_CHAIN_STRONG_SIGN_DISABLE_END_CHECK_FLAG: DWORD = 0x00000001; |
| 6683 |
pub const CERT_CHAIN_REVOCATION_CHECK_END_CERT: DWORD = 0x10000000; |
| 6684 |
pub const CERT_CHAIN_REVOCATION_CHECK_CHAIN: DWORD = 0x20000000; |
| 6685 |
pub const CERT_CHAIN_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT: DWORD = 0x40000000; |
| 6686 |
pub const CERT_CHAIN_REVOCATION_CHECK_CACHE_ONLY: DWORD = 0x80000000; |
| 6687 |
pub const CERT_CHAIN_REVOCATION_ACCUMULATIVE_TIMEOUT: DWORD = 0x08000000; |
| 6688 |
pub const CERT_CHAIN_REVOCATION_CHECK_OCSP_CERT: DWORD = 0x04000000; |
| 6689 |
pub const CERT_CHAIN_DISABLE_PASS1_QUALITY_FILTERING: DWORD = 0x00000040; |
| 6690 |
pub const CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS: DWORD = 0x00000080; |
| 6691 |
pub const CERT_CHAIN_DISABLE_AUTH_ROOT_AUTO_UPDATE: DWORD = 0x00000100; |
| 6692 |
pub const CERT_CHAIN_TIMESTAMP_TIME: DWORD = 0x00000200; |
| 6693 |
pub const CERT_CHAIN_ENABLE_PEER_TRUST: DWORD = 0x00000400; |
| 6694 |
pub const CERT_CHAIN_DISABLE_MY_PEER_TRUST: DWORD = 0x00000800; |
| 6695 |
pub const CERT_CHAIN_DISABLE_MD2_MD4: DWORD = 0x00001000; |
| 6696 |
pub const CERT_CHAIN_DISABLE_AIA: DWORD = 0x00002000; |
| 6697 |
pub const CERT_CHAIN_HAS_MOTW: DWORD = 0x00004000; |
| 6698 |
pub const CERT_CHAIN_ONLY_ADDITIONAL_AND_AUTH_ROOT: DWORD = 0x00008000; |
| 6699 |
pub const CERT_CHAIN_OPT_IN_WEAK_SIGNATURE: DWORD = 0x00010000; |
| 6700 |
extern "system" { |
| 6701 |
pub fn CertGetCertificateChain( |
| 6702 |
hChainEngine: HCERTCHAINENGINE, |
| 6703 |
pCertContext: PCCERT_CONTEXT, |
| 6704 |
pTime: LPFILETIME, |
| 6705 |
hAdditionalStore: HCERTSTORE, |
| 6706 |
pChainPara: PCERT_CHAIN_PARA, |
| 6707 |
dwFlags: DWORD, |
| 6708 |
pvReserved: LPVOID, |
| 6709 |
ppChainContext: *mut PCCERT_CHAIN_CONTEXT, |
| 6710 |
) -> BOOL; |
| 6711 |
pub fn CertFreeCertificateChain( |
| 6712 |
pChainContext: PCCERT_CHAIN_CONTEXT, |
| 6713 |
); |
| 6714 |
pub fn CertDuplicateCertificateChain( |
| 6715 |
pChainContext: PCCERT_CHAIN_CONTEXT, |
| 6716 |
) -> PCCERT_CHAIN_CONTEXT; |
| 6717 |
} |
| 6718 |
STRUCT!{struct CERT_REVOCATION_CHAIN_PARA { |
| 6719 |
cbSize: DWORD, |
| 6720 |
hChainEngine: HCERTCHAINENGINE, |
| 6721 |
hAdditionalStore: HCERTSTORE, |
| 6722 |
dwChainFlags: DWORD, |
| 6723 |
dwUrlRetrievalTimeout: DWORD, |
| 6724 |
pftCurrentTime: LPFILETIME, |
| 6725 |
pftCacheResync: LPFILETIME, |
| 6726 |
cbMaxUrlRetrievalByteCount: DWORD, |
| 6727 |
}} |
| 6728 |
pub const REVOCATION_OID_CRL_REVOCATION: LPCSTR = 1 as LPCSTR; |
| 6729 |
STRUCT!{struct CRL_REVOCATION_INFO { |
| 6730 |
pCrlEntry: PCRL_ENTRY, |
| 6731 |
pCrlContext: PCCRL_CONTEXT, |
| 6732 |
pCrlIssuerChain: PCCERT_CHAIN_CONTEXT, |
| 6733 |
}} |
| 6734 |
pub type PCRL_REVOCATION_INFO = *mut CRL_REVOCATION_INFO; |
| 6735 |
extern "system" { |
| 6736 |
pub fn CertFindChainInStore( |
| 6737 |
hCertStore: HCERTSTORE, |
| 6738 |
dwCertEncodingType: DWORD, |
| 6739 |
dwFindFlags: DWORD, |
| 6740 |
dwFindType: DWORD, |
| 6741 |
pvFindPara: *const c_void, |
| 6742 |
pPrevChainContext: PCCERT_CHAIN_CONTEXT, |
| 6743 |
) -> PCCERT_CHAIN_CONTEXT; |
| 6744 |
} |
| 6745 |
pub const CERT_CHAIN_FIND_BY_ISSUER: DWORD = 1; |
| 6746 |
FN!{stdcall PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK( |
| 6747 |
pCert: PCCERT_CONTEXT, |
| 6748 |
pvFindArg: *mut c_void, |
| 6749 |
) -> BOOL} |
| 6750 |
STRUCT!{struct CERT_CHAIN_FIND_ISSUER_PARA { |
| 6751 |
cbSize: DWORD, |
| 6752 |
pszUsageIdentifier: LPCSTR, |
| 6753 |
dwKeySpec: DWORD, |
| 6754 |
dwAcquirePrivateKeyFlags: DWORD, |
| 6755 |
cIssuer: DWORD, |
| 6756 |
rgIssuer: *mut CERT_NAME_BLOB, |
| 6757 |
pfnFindCallback: PFN_CERT_CHAIN_FIND_BY_ISSUER_CALLBACK, |
| 6758 |
pvFindArg: *mut c_void, |
| 6759 |
pdwIssuerChainIndex: *mut DWORD, |
| 6760 |
pdwIssuerElementIndex: *mut DWORD, |
| 6761 |
}} |
| 6762 |
pub type PCERT_CHAIN_FIND_ISSUER_PARA = *mut CERT_CHAIN_FIND_ISSUER_PARA; |
| 6763 |
pub type CERT_CHAIN_FIND_BY_ISSUER_PARA = CERT_CHAIN_FIND_ISSUER_PARA; |
| 6764 |
pub type PCERT_CHAIN_FIND_BY_ISSUER_PARA = *mut CERT_CHAIN_FIND_ISSUER_PARA; |
| 6765 |
pub const CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG: DWORD = 0x0001; |
| 6766 |
pub const CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG: DWORD = 0x0002; |
| 6767 |
pub const CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG: DWORD = 0x0004; |
| 6768 |
pub const CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG: DWORD = 0x0008; |
| 6769 |
pub const CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG: DWORD = 0x4000; |
| 6770 |
pub const CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG: DWORD = 0x8000; |
| 6771 |
STRUCT!{struct CERT_CHAIN_POLICY_PARA { |
| 6772 |
cbSize: DWORD, |
| 6773 |
dwFlags: DWORD, |
| 6774 |
pvExtraPolicyPara: *mut c_void, |
| 6775 |
}} |
| 6776 |
pub type PCERT_CHAIN_POLICY_PARA = *mut CERT_CHAIN_POLICY_PARA; |
| 6777 |
STRUCT!{struct CERT_CHAIN_POLICY_STATUS { |
| 6778 |
cbSize: DWORD, |
| 6779 |
dwError: DWORD, |
| 6780 |
lChainIndex: LONG, |
| 6781 |
lElementIndex: LONG, |
| 6782 |
pvExtraPolicyStatus: *mut c_void, |
| 6783 |
}} |
| 6784 |
pub type PCERT_CHAIN_POLICY_STATUS = *mut CERT_CHAIN_POLICY_STATUS; |
| 6785 |
pub const CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG: DWORD = 0x00000001; |
| 6786 |
pub const CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG: DWORD = 0x00000002; |
| 6787 |
pub const CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG: DWORD = 0x00000004; |
| 6788 |
pub const CERT_CHAIN_POLICY_IGNORE_INVALID_BASIC_CONSTRAINTS_FLAG: DWORD = 0x00000008; |
| 6789 |
pub const CERT_CHAIN_POLICY_IGNORE_ALL_NOT_TIME_VALID_FLAGS: DWORD |
| 6790 |
= CERT_CHAIN_POLICY_IGNORE_NOT_TIME_VALID_FLAG |
| 6791 |
| CERT_CHAIN_POLICY_IGNORE_CTL_NOT_TIME_VALID_FLAG |
| 6792 |
| CERT_CHAIN_POLICY_IGNORE_NOT_TIME_NESTED_FLAG; |
| 6793 |
pub const CERT_CHAIN_POLICY_ALLOW_UNKNOWN_CA_FLAG: DWORD = 0x00000010; |
| 6794 |
pub const CERT_CHAIN_POLICY_IGNORE_WRONG_USAGE_FLAG: DWORD = 0x00000020; |
| 6795 |
pub const CERT_CHAIN_POLICY_IGNORE_INVALID_NAME_FLAG: DWORD = 0x00000040; |
| 6796 |
pub const CERT_CHAIN_POLICY_IGNORE_INVALID_POLICY_FLAG: DWORD = 0x00000080; |
| 6797 |
pub const CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG: DWORD = 0x00000100; |
| 6798 |
pub const CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG: DWORD = 0x00000200; |
| 6799 |
pub const CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG: DWORD = 0x00000400; |
| 6800 |
pub const CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG: DWORD = 0x00000800; |
| 6801 |
pub const CERT_CHAIN_POLICY_IGNORE_ALL_REV_UNKNOWN_FLAGS: DWORD |
| 6802 |
= CERT_CHAIN_POLICY_IGNORE_END_REV_UNKNOWN_FLAG |
| 6803 |
| CERT_CHAIN_POLICY_IGNORE_CTL_SIGNER_REV_UNKNOWN_FLAG |
| 6804 |
| CERT_CHAIN_POLICY_IGNORE_CA_REV_UNKNOWN_FLAG |
| 6805 |
| CERT_CHAIN_POLICY_IGNORE_ROOT_REV_UNKNOWN_FLAG; |
| 6806 |
pub const CERT_CHAIN_POLICY_ALLOW_TESTROOT_FLAG: DWORD = 0x00008000; |
| 6807 |
pub const CERT_CHAIN_POLICY_TRUST_TESTROOT_FLAG: DWORD = 0x00004000; |
| 6808 |
pub const CERT_CHAIN_POLICY_IGNORE_NOT_SUPPORTED_CRITICAL_EXT_FLAG: DWORD = 0x00002000; |
| 6809 |
pub const CERT_CHAIN_POLICY_IGNORE_PEER_TRUST_FLAG: DWORD = 0x00001000; |
| 6810 |
pub const CERT_CHAIN_POLICY_IGNORE_WEAK_SIGNATURE_FLAG: DWORD = 0x08000000; |
| 6811 |
extern "system" { |
| 6812 |
pub fn CertVerifyCertificateChainPolicy( |
| 6813 |
pszPolicyOID: LPCSTR, |
| 6814 |
pChainContext: PCCERT_CHAIN_CONTEXT, |
| 6815 |
pPolicyPara: PCERT_CHAIN_POLICY_PARA, |
| 6816 |
pPolicyStatus: PCERT_CHAIN_POLICY_STATUS, |
| 6817 |
) -> BOOL; |
| 6818 |
} |
| 6819 |
pub const CRYPT_OID_VERIFY_CERTIFICATE_CHAIN_POLICY_FUNC: &'static str |
| 6820 |
= "CertDllVerifyCertificateChainPolicy"; |
| 6821 |
pub const CERT_CHAIN_POLICY_BASE: LPCSTR = 1 as LPCSTR; |
| 6822 |
pub const CERT_CHAIN_POLICY_AUTHENTICODE: LPCSTR = 2 as LPCSTR; |
| 6823 |
pub const CERT_CHAIN_POLICY_AUTHENTICODE_TS: LPCSTR = 3 as LPCSTR; |
| 6824 |
pub const CERT_CHAIN_POLICY_SSL: LPCSTR = 4 as LPCSTR; |
| 6825 |
pub const CERT_CHAIN_POLICY_BASIC_CONSTRAINTS: LPCSTR = 5 as LPCSTR; |
| 6826 |
pub const CERT_CHAIN_POLICY_NT_AUTH: LPCSTR = 6 as LPCSTR; |
| 6827 |
pub const CERT_CHAIN_POLICY_MICROSOFT_ROOT: LPCSTR = 7 as LPCSTR; |
| 6828 |
pub const CERT_CHAIN_POLICY_EV: LPCSTR = 8 as LPCSTR; |
| 6829 |
pub const CERT_CHAIN_POLICY_SSL_F12: LPCSTR = 9 as LPCSTR; |
| 6830 |
pub const CERT_CHAIN_POLICY_SSL_HPKP_HEADER: LPCSTR = 10 as LPCSTR; |
| 6831 |
pub const CERT_CHAIN_POLICY_THIRD_PARTY_ROOT: LPCSTR = 11 as LPCSTR; |
| 6832 |
pub const CERT_CHAIN_POLICY_SSL_KEY_PIN: LPCSTR = 12 as LPCSTR; |
| 6833 |
STRUCT!{struct AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA { |
| 6834 |
cbSize: DWORD, |
| 6835 |
dwRegPolicySettings: DWORD, |
| 6836 |
pSignerInfo: PCMSG_SIGNER_INFO, |
| 6837 |
}} |
| 6838 |
pub type PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA |
| 6839 |
= *mut AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_PARA; |
| 6840 |
STRUCT!{struct AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS { |
| 6841 |
cbSize: DWORD, |
| 6842 |
fCommercial: BOOL, |
| 6843 |
}} |
| 6844 |
pub type PAUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS |
| 6845 |
= *mut AUTHENTICODE_EXTRA_CERT_CHAIN_POLICY_STATUS; |
| 6846 |
STRUCT!{struct AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA { |
| 6847 |
cbSize: DWORD, |
| 6848 |
dwRegPolicySettings: DWORD, |
| 6849 |
fCommercial: BOOL, |
| 6850 |
}} |
| 6851 |
pub type PAUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA |
| 6852 |
= *mut AUTHENTICODE_TS_EXTRA_CERT_CHAIN_POLICY_PARA; |
| 6853 |
UNION!{union HTTPSPolicyCallbackData_u { |
| 6854 |
[u32; 1], |
| 6855 |
cbStruct cbStruct_mut: DWORD, |
| 6856 |
cbSize cbSize_mut: DWORD, |
| 6857 |
}} |
| 6858 |
STRUCT!{struct HTTPSPolicyCallbackData { |
| 6859 |
u: HTTPSPolicyCallbackData_u, |
| 6860 |
dwAuthType: DWORD, |
| 6861 |
fdwChecks: DWORD, |
| 6862 |
pwszServerName: *mut WCHAR, |
| 6863 |
}} |
| 6864 |
pub type PHTTPSPolicyCallbackData = *mut HTTPSPolicyCallbackData; |
| 6865 |
pub type SSL_EXTRA_CERT_CHAIN_POLICY_PARA = HTTPSPolicyCallbackData; |
| 6866 |
pub type PSSL_EXTRA_CERT_CHAIN_POLICY_PARA = *mut HTTPSPolicyCallbackData; |
| 6867 |
pub const AUTHTYPE_CLIENT: DWORD = 1; |
| 6868 |
pub const AUTHTYPE_SERVER: DWORD = 2; |
| 6869 |
pub const BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_CA_FLAG: DWORD = 0x80000000; |
| 6870 |
pub const BASIC_CONSTRAINTS_CERT_CHAIN_POLICY_END_ENTITY_FLAG: DWORD = 0x40000000; |
| 6871 |
pub const MICROSOFT_ROOT_CERT_CHAIN_POLICY_ENABLE_TEST_ROOT_FLAG: DWORD = 0x00010000; |
| 6872 |
pub const MICROSOFT_ROOT_CERT_CHAIN_POLICY_CHECK_APPLICATION_ROOT_FLAG: DWORD = 0x00020000; |
| 6873 |
pub const MICROSOFT_ROOT_CERT_CHAIN_POLICY_DISABLE_FLIGHT_ROOT_FLAG: DWORD = 0x00040000; |
| 6874 |
STRUCT!{struct EV_EXTRA_CERT_CHAIN_POLICY_PARA { |
| 6875 |
cbSize: DWORD, |
| 6876 |
dwRootProgramQualifierFlags: DWORD, |
| 6877 |
}} |
| 6878 |
pub type PEV_EXTRA_CERT_CHAIN_POLICY_PARA = *mut EV_EXTRA_CERT_CHAIN_POLICY_PARA; |
| 6879 |
STRUCT!{struct EV_EXTRA_CERT_CHAIN_POLICY_STATUS { |
| 6880 |
cbSize: DWORD, |
| 6881 |
dwQualifiers: DWORD, |
| 6882 |
dwIssuanceUsageIndex: DWORD, |
| 6883 |
}} |
| 6884 |
pub type PEV_EXTRA_CERT_CHAIN_POLICY_STATUS = *mut EV_EXTRA_CERT_CHAIN_POLICY_STATUS; |
| 6885 |
pub const SSL_F12_ERROR_TEXT_LENGTH: usize = 256; |
| 6886 |
STRUCT!{struct SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS { |
| 6887 |
cbSize: DWORD, |
| 6888 |
dwErrorLevel: DWORD, |
| 6889 |
dwErrorCategory: DWORD, |
| 6890 |
dwReserved: DWORD, |
| 6891 |
wszErrorText: [WCHAR; SSL_F12_ERROR_TEXT_LENGTH], |
| 6892 |
}} |
| 6893 |
pub type PSSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS = *mut SSL_F12_EXTRA_CERT_CHAIN_POLICY_STATUS; |
| 6894 |
pub const CERT_CHAIN_POLICY_SSL_F12_SUCCESS_LEVEL: DWORD = 0; |
| 6895 |
pub const CERT_CHAIN_POLICY_SSL_F12_WARNING_LEVEL: DWORD = 1; |
| 6896 |
pub const CERT_CHAIN_POLICY_SSL_F12_ERROR_LEVEL: DWORD = 2; |
| 6897 |
pub const CERT_CHAIN_POLICY_SSL_F12_NONE_CATEGORY: DWORD = 0; |
| 6898 |
pub const CERT_CHAIN_POLICY_SSL_F12_WEAK_CRYPTO_CATEGORY: DWORD = 1; |
| 6899 |
pub const CERT_CHAIN_POLICY_SSL_F12_ROOT_PROGRAM_CATEGORY: DWORD = 2; |
| 6900 |
pub const SSL_HPKP_PKP_HEADER_INDEX: usize = 0; |
| 6901 |
pub const SSL_HPKP_PKP_RO_HEADER_INDEX: usize = 1; |
| 6902 |
pub const SSL_HPKP_HEADER_COUNT: usize = 2; |
| 6903 |
STRUCT!{struct SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA { |
| 6904 |
cbSize: DWORD, |
| 6905 |
dwReserved: DWORD, |
| 6906 |
pwszServerName: LPWSTR, |
| 6907 |
rgpszHpkpValue: [LPSTR; SSL_HPKP_HEADER_COUNT], |
| 6908 |
}} |
| 6909 |
pub type PSSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA |
| 6910 |
= *mut SSL_HPKP_HEADER_EXTRA_CERT_CHAIN_POLICY_PARA; |
| 6911 |
STRUCT!{struct SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA { |
| 6912 |
cbSize: DWORD, |
| 6913 |
dwReserved: DWORD, |
| 6914 |
pwszServerName: PCWSTR, |
| 6915 |
}} |
| 6916 |
pub type PSSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA = *mut SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_PARA; |
| 6917 |
pub const SSL_KEY_PIN_ERROR_TEXT_LENGTH: usize = 512; |
| 6918 |
STRUCT!{struct SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS { |
| 6919 |
cbSize: DWORD, |
| 6920 |
lError: LONG, |
| 6921 |
wszErrorText: [WCHAR; SSL_KEY_PIN_ERROR_TEXT_LENGTH], |
| 6922 |
}} |
| 6923 |
pub type PSSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS |
| 6924 |
= *mut SSL_KEY_PIN_EXTRA_CERT_CHAIN_POLICY_STATUS; |
| 6925 |
pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MISMATCH_ERROR: LONG = -2; |
| 6926 |
pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MITM_ERROR: LONG = -1; |
| 6927 |
pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_SUCCESS: LONG = 0; |
| 6928 |
pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MITM_WARNING: LONG = 1; |
| 6929 |
pub const CERT_CHAIN_POLICY_SSL_KEY_PIN_MISMATCH_WARNING: LONG = 2; |
| 6930 |
extern "system" { |
| 6931 |
pub fn CryptStringToBinaryA( |
| 6932 |
pszString: LPCSTR, |
| 6933 |
cchString: DWORD, |
| 6934 |
dwFlags: DWORD, |
| 6935 |
pbBinary: *mut BYTE, |
| 6936 |
pcbBinary: *mut DWORD, |
| 6937 |
pdwSkip: *mut DWORD, |
| 6938 |
pdwFlags: *mut DWORD, |
| 6939 |
) -> BOOL; |
| 6940 |
pub fn CryptStringToBinaryW( |
| 6941 |
pszString: LPCWSTR, |
| 6942 |
cchString: DWORD, |
| 6943 |
dwFlags: DWORD, |
| 6944 |
pbBinary: *mut BYTE, |
| 6945 |
pcbBinary: *mut DWORD, |
| 6946 |
pdwSkip: *mut DWORD, |
| 6947 |
pdwFlags: *mut DWORD, |
| 6948 |
) -> BOOL; |
| 6949 |
pub fn CryptBinaryToStringA( |
| 6950 |
pbBinary: *const BYTE, |
| 6951 |
cbBinary: DWORD, |
| 6952 |
dwFlags: DWORD, |
| 6953 |
pszString: LPSTR, |
| 6954 |
pcchString: *mut DWORD, |
| 6955 |
) -> BOOL; |
| 6956 |
pub fn CryptBinaryToStringW( |
| 6957 |
pbBinary: *const BYTE, |
| 6958 |
cbBinary: DWORD, |
| 6959 |
dwFlags: DWORD, |
| 6960 |
pszString: LPWSTR, |
| 6961 |
pcchString: *mut DWORD, |
| 6962 |
) -> BOOL; |
| 6963 |
} |
| 6964 |
pub const CRYPT_STRING_BASE64HEADER: DWORD = 0x00000000; |
| 6965 |
pub const CRYPT_STRING_BASE64: DWORD = 0x00000001; |
| 6966 |
pub const CRYPT_STRING_BINARY: DWORD = 0x00000002; |
| 6967 |
pub const CRYPT_STRING_BASE64REQUESTHEADER: DWORD = 0x00000003; |
| 6968 |
pub const CRYPT_STRING_HEX: DWORD = 0x00000004; |
| 6969 |
pub const CRYPT_STRING_HEXASCII: DWORD = 0x00000005; |
| 6970 |
pub const CRYPT_STRING_BASE64_ANY: DWORD = 0x00000006; |
| 6971 |
pub const CRYPT_STRING_ANY: DWORD = 0x00000007; |
| 6972 |
pub const CRYPT_STRING_HEX_ANY: DWORD = 0x00000008; |
| 6973 |
pub const CRYPT_STRING_BASE64X509CRLHEADER: DWORD = 0x00000009; |
| 6974 |
pub const CRYPT_STRING_HEXADDR: DWORD = 0x0000000a; |
| 6975 |
pub const CRYPT_STRING_HEXASCIIADDR: DWORD = 0x0000000b; |
| 6976 |
pub const CRYPT_STRING_HEXRAW: DWORD = 0x0000000c; |
| 6977 |
pub const CRYPT_STRING_BASE64URI: DWORD = 0x0000000d; |
| 6978 |
pub const CRYPT_STRING_ENCODEMASK: DWORD = 0x000000ff; |
| 6979 |
pub const CRYPT_STRING_RESERVED100: DWORD = 0x00000100; |
| 6980 |
pub const CRYPT_STRING_RESERVED200: DWORD = 0x00000200; |
| 6981 |
pub const CRYPT_STRING_PERCENTESCAPE: DWORD = 0x08000000; |
| 6982 |
pub const CRYPT_STRING_HASHDATA: DWORD = 0x10000000; |
| 6983 |
pub const CRYPT_STRING_STRICT: DWORD = 0x20000000; |
| 6984 |
pub const CRYPT_STRING_NOCRLF: DWORD = 0x40000000; |
| 6985 |
pub const CRYPT_STRING_NOCR: DWORD = 0x80000000; |
| 6986 |
pub const szOID_PKCS_12_PbeIds: &'static str = "1.2.840.113549.1.12.1"; |
| 6987 |
pub const szOID_PKCS_12_pbeWithSHA1And128BitRC4: &'static str = "1.2.840.113549.1.12.1.1"; |
| 6988 |
pub const szOID_PKCS_12_pbeWithSHA1And40BitRC4: &'static str = "1.2.840.113549.1.12.1.2"; |
| 6989 |
pub const szOID_PKCS_12_pbeWithSHA1And3KeyTripleDES: &'static str = "1.2.840.113549.1.12.1.3"; |
| 6990 |
pub const szOID_PKCS_12_pbeWithSHA1And2KeyTripleDES: &'static str = "1.2.840.113549.1.12.1.4"; |
| 6991 |
pub const szOID_PKCS_12_pbeWithSHA1And128BitRC2: &'static str = "1.2.840.113549.1.12.1.5"; |
| 6992 |
pub const szOID_PKCS_12_pbeWithSHA1And40BitRC2: &'static str = "1.2.840.113549.1.12.1.6"; |
| 6993 |
STRUCT!{struct CRYPT_PKCS12_PBE_PARAMS { |
| 6994 |
iIterations: c_int, |
| 6995 |
cbSalt: ULONG, |
| 6996 |
}} |
| 6997 |
extern "system" { |
| 6998 |
pub fn PFXImportCertStore( |
| 6999 |
pPFX: *mut CRYPT_DATA_BLOB, |
| 7000 |
szPassword: LPCWSTR, |
| 7001 |
dwFlags: DWORD, |
| 7002 |
) -> HCERTSTORE; |
| 7003 |
} |
| 7004 |
pub const PKCS12_IMPORT_SILENT: DWORD = 0x00000040; |
| 7005 |
pub const CRYPT_USER_KEYSET: DWORD = 0x00001000; |
| 7006 |
pub const PKCS12_PREFER_CNG_KSP: DWORD = 0x00000100; |
| 7007 |
pub const PKCS12_ALWAYS_CNG_KSP: DWORD = 0x00000200; |
| 7008 |
pub const PKCS12_ONLY_CERTIFICATES: DWORD = 0x00000400; |
| 7009 |
pub const PKCS12_ONLY_NOT_ENCRYPTED_CERTIFICATES: DWORD = 0x00000800; |
| 7010 |
pub const PKCS12_ALLOW_OVERWRITE_KEY: DWORD = 0x00004000; |
| 7011 |
pub const PKCS12_NO_PERSIST_KEY: DWORD = 0x00008000; |
| 7012 |
pub const PKCS12_IMPORT_RESERVED_MASK: DWORD = 0xffff0000; |
| 7013 |
pub const PKCS12_OBJECT_LOCATOR_ALL_IMPORT_FLAGS: DWORD = PKCS12_ALWAYS_CNG_KSP |
| 7014 |
| PKCS12_NO_PERSIST_KEY | PKCS12_IMPORT_SILENT | PKCS12_INCLUDE_EXTENDED_PROPERTIES; |
| 7015 |
pub const PKCS12_ONLY_CERTIFICATES_PROVIDER_TYPE: DWORD = 0; |
| 7016 |
pub const PKCS12_ONLY_CERTIFICATES_PROVIDER_NAME: &'static str = "PfxProvider"; |
| 7017 |
pub const PKCS12_ONLY_CERTIFICATES_CONTAINER_NAME: &'static str = "PfxContainer"; |
| 7018 |
extern "system" { |
| 7019 |
pub fn PFXIsPFXBlob( |
| 7020 |
pPFX: *mut CRYPT_DATA_BLOB, |
| 7021 |
) -> BOOL; |
| 7022 |
pub fn PFXVerifyPassword( |
| 7023 |
pPFX: *mut CRYPT_DATA_BLOB, |
| 7024 |
szPassword: LPCWSTR, |
| 7025 |
dwFlags: DWORD, |
| 7026 |
) -> BOOL; |
| 7027 |
pub fn PFXExportCertStoreEx( |
| 7028 |
hStore: HCERTSTORE, |
| 7029 |
pPFX: *mut CRYPT_DATA_BLOB, |
| 7030 |
szPassword: LPCWSTR, |
| 7031 |
pvPara: *mut c_void, |
| 7032 |
dwFlags: DWORD, |
| 7033 |
) -> BOOL; |
| 7034 |
} |
| 7035 |
pub const REPORT_NO_PRIVATE_KEY: DWORD = 0x0001; |
| 7036 |
pub const REPORT_NOT_ABLE_TO_EXPORT_PRIVATE_KEY: DWORD = 0x0002; |
| 7037 |
pub const EXPORT_PRIVATE_KEYS: DWORD = 0x0004; |
| 7038 |
pub const PKCS12_INCLUDE_EXTENDED_PROPERTIES: DWORD = 0x0010; |
| 7039 |
pub const PKCS12_PROTECT_TO_DOMAIN_SIDS: DWORD = 0x0020; |
| 7040 |
pub const PKCS12_EXPORT_SILENT: DWORD = 0x0040; |
| 7041 |
pub const PKCS12_DISABLE_ENCRYPT_CERTIFICATES: DWORD = 0x0100; |
| 7042 |
pub const PKCS12_ENCRYPT_CERTIFICATES: DWORD = 0x0200; |
| 7043 |
pub const PKCS12_EXPORT_ECC_CURVE_PARAMETERS: DWORD = 0x1000; |
| 7044 |
pub const PKCS12_EXPORT_ECC_CURVE_OID: DWORD = 0x2000; |
| 7045 |
pub const PKCS12_EXPORT_RESERVED_MASK: DWORD = 0xffff0000; |
| 7046 |
pub const PKCS12_CONFIG_REGPATH: &'static str |
| 7047 |
= "Software\\Microsoft\\Windows\\CurrentVersion\\PFX"; |
| 7048 |
pub const PKCS12_ENCRYPT_CERTIFICATES_VALUE_NAME: &'static str = "EncryptCertificates"; |
| 7049 |
extern "system" { |
| 7050 |
pub fn PFXExportCertStore( |
| 7051 |
hStore: HCERTSTORE, |
| 7052 |
pPFX: *mut CRYPT_DATA_BLOB, |
| 7053 |
szPassword: LPCWSTR, |
| 7054 |
dwFlags: DWORD, |
| 7055 |
) -> BOOL; |
| 7056 |
} |
| 7057 |
pub type HCERT_SERVER_OCSP_RESPONSE = *mut c_void; |
| 7058 |
pub type PCERT_SERVER_OCSP_RESPONSE_CONTEXT = *mut CERT_SERVER_OCSP_RESPONSE_CONTEXT; |
| 7059 |
pub type PCCERT_SERVER_OCSP_RESPONSE_CONTEXT = *const CERT_SERVER_OCSP_RESPONSE_CONTEXT; |
| 7060 |
STRUCT!{struct CERT_SERVER_OCSP_RESPONSE_CONTEXT { |
| 7061 |
cbSize: DWORD, |
| 7062 |
pbEncodedOcspResponse: *mut BYTE, |
| 7063 |
cbEncodedOcspResponse: DWORD, |
| 7064 |
}} |
| 7065 |
FN!{stdcall PFN_CERT_SERVER_OCSP_RESPONSE_UPDATE_CALLBACK( |
| 7066 |
pChainContext: PCCERT_CHAIN_CONTEXT, |
| 7067 |
pServerOcspResponseContext: PCCERT_SERVER_OCSP_RESPONSE_CONTEXT, |
| 7068 |
pNewCrlContext: PCCRL_CONTEXT, |
| 7069 |
pPrevCrlContext: PCCRL_CONTEXT, |
| 7070 |
pvArg: PVOID, |
| 7071 |
dwWriteOcspFileError: DWORD, |
| 7072 |
) -> ()} |
| 7073 |
STRUCT!{struct CERT_SERVER_OCSP_RESPONSE_OPEN_PARA { |
| 7074 |
cbSize: DWORD, |
| 7075 |
dwFlags: DWORD, |
| 7076 |
pcbUsedSize: *mut DWORD, |
| 7077 |
pwszOcspDirectory: PWSTR, |
| 7078 |
pfnUpdateCallback: PFN_CERT_SERVER_OCSP_RESPONSE_UPDATE_CALLBACK, |
| 7079 |
pvUpdateCallbackArg: PVOID, |
| 7080 |
}} |
| 7081 |
pub type PCERT_SERVER_OCSP_RESPONSE_OPEN_PARA = *mut CERT_SERVER_OCSP_RESPONSE_OPEN_PARA; |
| 7082 |
pub const CERT_SERVER_OCSP_RESPONSE_OPEN_PARA_READ_FLAG: DWORD = 0x00000001; |
| 7083 |
pub const CERT_SERVER_OCSP_RESPONSE_OPEN_PARA_WRITE_FLAG: DWORD = 0x00000002; |
| 7084 |
extern "system" { |
| 7085 |
pub fn CertOpenServerOcspResponse( |
| 7086 |
pChainContext: PCCERT_CHAIN_CONTEXT, |
| 7087 |
dwFlags: DWORD, |
| 7088 |
pvReserved: LPVOID, |
| 7089 |
) -> HCERT_SERVER_OCSP_RESPONSE; |
| 7090 |
} |
| 7091 |
pub const CERT_SERVER_OCSP_RESPONSE_ASYNC_FLAG: DWORD = 0x00000001; |
| 7092 |
extern "system" { |
| 7093 |
pub fn CertAddRefServerOcspResponse( |
| 7094 |
hServerOcspResponse: HCERT_SERVER_OCSP_RESPONSE, |
| 7095 |
); |
| 7096 |
pub fn CertCloseServerOcspResponse( |
| 7097 |
hServerOcspResponse: HCERT_SERVER_OCSP_RESPONSE, |
| 7098 |
dwFlags: DWORD, |
| 7099 |
); |
| 7100 |
pub fn CertGetServerOcspResponseContext( |
| 7101 |
hServerOcspResponse: HCERT_SERVER_OCSP_RESPONSE, |
| 7102 |
dwFlags: DWORD, |
| 7103 |
pvReserved: LPVOID, |
| 7104 |
) -> PCCERT_SERVER_OCSP_RESPONSE_CONTEXT; |
| 7105 |
pub fn CertAddRefServerOcspResponseContext( |
| 7106 |
pServerOcspResponseContext: PCCERT_SERVER_OCSP_RESPONSE_CONTEXT, |
| 7107 |
); |
| 7108 |
pub fn CertFreeServerOcspResponseContext( |
| 7109 |
pServerOcspResponseContext: PCCERT_SERVER_OCSP_RESPONSE_CONTEXT, |
| 7110 |
); |
| 7111 |
pub fn CertRetrieveLogoOrBiometricInfo( |
| 7112 |
pCertContext: PCCERT_CONTEXT, |
| 7113 |
lpszLogoOrBiometricType: LPCSTR, |
| 7114 |
dwRetrievalFlags: DWORD, |
| 7115 |
dwTimeout: DWORD, |
| 7116 |
dwFlags: DWORD, |
| 7117 |
pvReserved: *mut c_void, |
| 7118 |
ppbData: *mut *mut BYTE, |
| 7119 |
pcbData: *mut DWORD, |
| 7120 |
ppwszMimeType: *mut LPWSTR, |
| 7121 |
) -> BOOL; |
| 7122 |
} |
| 7123 |
pub const CERT_RETRIEVE_ISSUER_LOGO: LPCSTR = 1 as LPCSTR; |
| 7124 |
pub const CERT_RETRIEVE_SUBJECT_LOGO: LPCSTR = 2 as LPCSTR; |
| 7125 |
pub const CERT_RETRIEVE_COMMUNITY_LOGO: LPCSTR = 3 as LPCSTR; |
| 7126 |
pub const CERT_RETRIEVE_BIOMETRIC_PREDEFINED_BASE_TYPE: LPCSTR = 1000 as LPCSTR; |
| 7127 |
pub const CERT_RETRIEVE_BIOMETRIC_PICTURE_TYPE: LPCSTR |
| 7128 |
= (1000 + CERT_BIOMETRIC_PICTURE_TYPE) as LPCSTR; |
| 7129 |
pub const CERT_RETRIEVE_BIOMETRIC_SIGNATURE_TYPE: LPCSTR |
| 7130 |
= (1000 + CERT_BIOMETRIC_SIGNATURE_TYPE) as LPCSTR; |
| 7131 |
STRUCT!{struct CERT_SELECT_CHAIN_PARA { |
| 7132 |
hChainEngine: HCERTCHAINENGINE, |
| 7133 |
pTime: PFILETIME, |
| 7134 |
hAdditionalStore: HCERTSTORE, |
| 7135 |
pChainPara: PCERT_CHAIN_PARA, |
| 7136 |
dwFlags: DWORD, |
| 7137 |
}} |
| 7138 |
pub type PCERT_SELECT_CHAIN_PARA = *mut CERT_SELECT_CHAIN_PARA; |
| 7139 |
pub type PCCERT_SELECT_CHAIN_PARA = *const CERT_SELECT_CHAIN_PARA; |
| 7140 |
pub const CERT_SELECT_MAX_PARA: DWORD = 500; |
| 7141 |
STRUCT!{struct CERT_SELECT_CRITERIA { |
| 7142 |
dwType: DWORD, |
| 7143 |
cPara: DWORD, |
| 7144 |
ppPara: *mut *mut c_void, |
| 7145 |
}} |
| 7146 |
pub type PCERT_SELECT_CRITERIA = *mut CERT_SELECT_CRITERIA; |
| 7147 |
pub type PCCERT_SELECT_CRITERIA = *const CERT_SELECT_CRITERIA; |
| 7148 |
pub const CERT_SELECT_BY_ENHKEY_USAGE: DWORD = 1; |
| 7149 |
pub const CERT_SELECT_BY_KEY_USAGE: DWORD = 2; |
| 7150 |
pub const CERT_SELECT_BY_POLICY_OID: DWORD = 3; |
| 7151 |
pub const CERT_SELECT_BY_PROV_NAME: DWORD = 4; |
| 7152 |
pub const CERT_SELECT_BY_EXTENSION: DWORD = 5; |
| 7153 |
pub const CERT_SELECT_BY_SUBJECT_HOST_NAME: DWORD = 6; |
| 7154 |
pub const CERT_SELECT_BY_ISSUER_ATTR: DWORD = 7; |
| 7155 |
pub const CERT_SELECT_BY_SUBJECT_ATTR: DWORD = 8; |
| 7156 |
pub const CERT_SELECT_BY_ISSUER_NAME: DWORD = 9; |
| 7157 |
pub const CERT_SELECT_BY_PUBLIC_KEY: DWORD = 10; |
| 7158 |
pub const CERT_SELECT_BY_TLS_SIGNATURES: DWORD = 11; |
| 7159 |
pub const CERT_SELECT_BY_ISSUER_DISPLAYNAME: DWORD = 12; |
| 7160 |
pub const CERT_SELECT_BY_FRIENDLYNAME: DWORD = 13; |
| 7161 |
pub const CERT_SELECT_BY_THUMBPRINT: DWORD = 14; |
| 7162 |
pub const CERT_SELECT_LAST: DWORD = CERT_SELECT_BY_TLS_SIGNATURES; |
| 7163 |
pub const CERT_SELECT_MAX: DWORD = CERT_SELECT_LAST * 3; |
| 7164 |
pub const CERT_SELECT_ALLOW_EXPIRED: DWORD = 0x00000001; |
| 7165 |
pub const CERT_SELECT_TRUSTED_ROOT: DWORD = 0x00000002; |
| 7166 |
pub const CERT_SELECT_DISALLOW_SELFSIGNED: DWORD = 0x00000004; |
| 7167 |
pub const CERT_SELECT_HAS_PRIVATE_KEY: DWORD = 0x00000008; |
| 7168 |
pub const CERT_SELECT_HAS_KEY_FOR_SIGNATURE: DWORD = 0x00000010; |
| 7169 |
pub const CERT_SELECT_HAS_KEY_FOR_KEY_EXCHANGE: DWORD = 0x00000020; |
| 7170 |
pub const CERT_SELECT_HARDWARE_ONLY: DWORD = 0x00000040; |
| 7171 |
pub const CERT_SELECT_ALLOW_DUPLICATES: DWORD = 0x00000080; |
| 7172 |
pub const CERT_SELECT_IGNORE_AUTOSELECT: DWORD = 0x00000100; |
| 7173 |
extern "system" { |
| 7174 |
pub fn CertSelectCertificateChains( |
| 7175 |
pSelectionContext: LPCGUID, |
| 7176 |
dwFlags: DWORD, |
| 7177 |
pChainParameters: PCCERT_SELECT_CHAIN_PARA, |
| 7178 |
cCriteria: DWORD, |
| 7179 |
rgpCriteria: PCCERT_SELECT_CRITERIA, |
| 7180 |
hStore: HCERTSTORE, |
| 7181 |
pcSelection: PDWORD, |
| 7182 |
pprgpSelection: *mut *mut PCCERT_CHAIN_CONTEXT, |
| 7183 |
) -> BOOL; |
| 7184 |
pub fn CertFreeCertificateChainList( |
| 7185 |
prgpSelection: *mut PCCERT_CHAIN_CONTEXT, |
| 7186 |
); |
| 7187 |
} |
| 7188 |
pub const TIMESTAMP_VERSION: DWORD = 1; |
| 7189 |
STRUCT!{struct CRYPT_TIMESTAMP_REQUEST { |
| 7190 |
dwVersion: DWORD, |
| 7191 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 7192 |
HashedMessage: CRYPT_DER_BLOB, |
| 7193 |
pszTSAPolicyId: LPSTR, |
| 7194 |
Nonce: CRYPT_INTEGER_BLOB, |
| 7195 |
fCertReq: BOOL, |
| 7196 |
cExtension: DWORD, |
| 7197 |
rgExtension: PCERT_EXTENSION, |
| 7198 |
}} |
| 7199 |
pub type PCRYPT_TIMESTAMP_REQUEST = *mut CRYPT_TIMESTAMP_REQUEST; |
| 7200 |
STRUCT!{struct CRYPT_TIMESTAMP_RESPONSE { |
| 7201 |
dwStatus: DWORD, |
| 7202 |
cFreeText: DWORD, |
| 7203 |
rgFreeText: *mut LPWSTR, |
| 7204 |
FailureInfo: CRYPT_BIT_BLOB, |
| 7205 |
ContentInfo: CRYPT_DER_BLOB, |
| 7206 |
}} |
| 7207 |
pub type PCRYPT_TIMESTAMP_RESPONSE = *mut CRYPT_TIMESTAMP_RESPONSE; |
| 7208 |
pub const TIMESTAMP_STATUS_GRANTED: DWORD = 0; |
| 7209 |
pub const TIMESTAMP_STATUS_GRANTED_WITH_MODS: DWORD = 1; |
| 7210 |
pub const TIMESTAMP_STATUS_REJECTED: DWORD = 2; |
| 7211 |
pub const TIMESTAMP_STATUS_WAITING: DWORD = 3; |
| 7212 |
pub const TIMESTAMP_STATUS_REVOCATION_WARNING: DWORD = 4; |
| 7213 |
pub const TIMESTAMP_STATUS_REVOKED: DWORD = 5; |
| 7214 |
pub const TIMESTAMP_FAILURE_BAD_ALG: DWORD = 0; |
| 7215 |
pub const TIMESTAMP_FAILURE_BAD_REQUEST: DWORD = 2; |
| 7216 |
pub const TIMESTAMP_FAILURE_BAD_FORMAT: DWORD = 5; |
| 7217 |
pub const TIMESTAMP_FAILURE_TIME_NOT_AVAILABLE: DWORD = 14; |
| 7218 |
pub const TIMESTAMP_FAILURE_POLICY_NOT_SUPPORTED: DWORD = 15; |
| 7219 |
pub const TIMESTAMP_FAILURE_EXTENSION_NOT_SUPPORTED: DWORD = 16; |
| 7220 |
pub const TIMESTAMP_FAILURE_INFO_NOT_AVAILABLE: DWORD = 17; |
| 7221 |
pub const TIMESTAMP_FAILURE_SYSTEM_FAILURE: DWORD = 25; |
| 7222 |
STRUCT!{struct CRYPT_TIMESTAMP_ACCURACY { |
| 7223 |
dwSeconds: DWORD, |
| 7224 |
dwMillis: DWORD, |
| 7225 |
dwMicros: DWORD, |
| 7226 |
}} |
| 7227 |
pub type PCRYPT_TIMESTAMP_ACCURACY = *mut CRYPT_TIMESTAMP_ACCURACY; |
| 7228 |
STRUCT!{struct CRYPT_TIMESTAMP_INFO { |
| 7229 |
dwVersion: DWORD, |
| 7230 |
pszTSAPolicyId: LPSTR, |
| 7231 |
HashAlgorithm: CRYPT_ALGORITHM_IDENTIFIER, |
| 7232 |
HashedMessage: CRYPT_DER_BLOB, |
| 7233 |
SerialNumber: CRYPT_INTEGER_BLOB, |
| 7234 |
ftTime: FILETIME, |
| 7235 |
pvAccuracy: PCRYPT_TIMESTAMP_ACCURACY, |
| 7236 |
fOrdering: BOOL, |
| 7237 |
Nonce: CRYPT_DER_BLOB, |
| 7238 |
Tsa: CRYPT_DER_BLOB, |
| 7239 |
cExtension: DWORD, |
| 7240 |
rgExtension: PCERT_EXTENSION, |
| 7241 |
}} |
| 7242 |
pub type PCRYPT_TIMESTAMP_INFO = *mut CRYPT_TIMESTAMP_INFO; |
| 7243 |
STRUCT!{struct CRYPT_TIMESTAMP_CONTEXT { |
| 7244 |
cbEncoded: DWORD, |
| 7245 |
pbEncoded: *mut BYTE, |
| 7246 |
pTimeStamp: PCRYPT_TIMESTAMP_INFO, |
| 7247 |
}} |
| 7248 |
pub type PCRYPT_TIMESTAMP_CONTEXT = *mut CRYPT_TIMESTAMP_CONTEXT; |
| 7249 |
STRUCT!{struct CRYPT_TIMESTAMP_PARA { |
| 7250 |
pszTSAPolicyId: LPCSTR, |
| 7251 |
fRequestCerts: BOOL, |
| 7252 |
Nonce: CRYPT_INTEGER_BLOB, |
| 7253 |
cExtension: DWORD, |
| 7254 |
rgExtension: PCERT_EXTENSION, |
| 7255 |
}} |
| 7256 |
pub type PCRYPT_TIMESTAMP_PARA = *mut CRYPT_TIMESTAMP_PARA; |
| 7257 |
extern "system" { |
| 7258 |
pub fn CryptRetrieveTimeStamp( |
| 7259 |
wszUrl: LPCWSTR, |
| 7260 |
dwRetrievalFlags: DWORD, |
| 7261 |
dwTimeout: DWORD, |
| 7262 |
pszHashId: LPCSTR, |
| 7263 |
pPara: *const CRYPT_TIMESTAMP_PARA, |
| 7264 |
pbData: *const BYTE, |
| 7265 |
cbData: DWORD, |
| 7266 |
ppTsContext: *mut PCRYPT_TIMESTAMP_CONTEXT, |
| 7267 |
ppTsSigner: *mut PCCERT_CONTEXT, |
| 7268 |
phStore: *mut HCERTSTORE, |
| 7269 |
) -> BOOL; |
| 7270 |
} |
| 7271 |
pub const TIMESTAMP_DONT_HASH_DATA: DWORD = 0x00000001; |
| 7272 |
pub const TIMESTAMP_VERIFY_CONTEXT_SIGNATURE: DWORD = 0x00000020; |
| 7273 |
pub const TIMESTAMP_NO_AUTH_RETRIEVAL: DWORD = 0x00020000; |
| 7274 |
extern "system" { |
| 7275 |
pub fn CryptVerifyTimeStampSignature( |
| 7276 |
pbTSContentInfo: *const BYTE, |
| 7277 |
cbTSContentInfo: DWORD, |
| 7278 |
pbData: *const BYTE, |
| 7279 |
cbData: DWORD, |
| 7280 |
hAdditionalStore: HCERTSTORE, |
| 7281 |
ppTsContext: *mut PCRYPT_TIMESTAMP_CONTEXT, |
| 7282 |
ppTsSigner: *mut PCCERT_CONTEXT, |
| 7283 |
phStore: *mut HCERTSTORE, |
| 7284 |
) -> BOOL; |
| 7285 |
} |
| 7286 |
pub const CRYPT_OBJECT_LOCATOR_SPN_NAME_TYPE: DWORD = 1; |
| 7287 |
pub const CRYPT_OBJECT_LOCATOR_LAST_RESERVED_NAME_TYPE: DWORD = 32; |
| 7288 |
pub const CRYPT_OBJECT_LOCATOR_FIRST_RESERVED_USER_NAME_TYPE: DWORD = 33; |
| 7289 |
pub const CRYPT_OBJECT_LOCATOR_LAST_RESERVED_USER_NAME_TYPE: DWORD = 0x0000FFFF; |
| 7290 |
pub const SSL_OBJECT_LOCATOR_PFX_FUNC: &'static str = "SslObjectLocatorInitializePfx"; |
| 7291 |
pub const SSL_OBJECT_LOCATOR_ISSUER_LIST_FUNC: &'static str |
| 7292 |
= "SslObjectLocatorInitializeIssuerList"; |
| 7293 |
pub const SSL_OBJECT_LOCATOR_CERT_VALIDATION_CONFIG_FUNC: &'static str |
| 7294 |
= "SslObjectLocatorInitializeCertValidationConfig"; |
| 7295 |
pub const CRYPT_OBJECT_LOCATOR_RELEASE_SYSTEM_SHUTDOWN: DWORD = 1; |
| 7296 |
pub const CRYPT_OBJECT_LOCATOR_RELEASE_SERVICE_STOP: DWORD = 2; |
| 7297 |
pub const CRYPT_OBJECT_LOCATOR_RELEASE_PROCESS_EXIT: DWORD = 3; |
| 7298 |
pub const CRYPT_OBJECT_LOCATOR_RELEASE_DLL_UNLOAD: DWORD = 4; |
| 7299 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FLUSH( |
| 7300 |
pContext: LPVOID, |
| 7301 |
rgIdentifierOrNameList: *mut PCERT_NAME_BLOB, |
| 7302 |
dwIdentifierOrNameListCount: DWORD, |
| 7303 |
) -> BOOL} |
| 7304 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET( |
| 7305 |
pPluginContext: LPVOID, |
| 7306 |
pIdentifier: PCRYPT_DATA_BLOB, |
| 7307 |
dwNameType: DWORD, |
| 7308 |
pNameBlob: PCERT_NAME_BLOB, |
| 7309 |
ppbContent: *mut PBYTE, |
| 7310 |
pcbContent: *mut DWORD, |
| 7311 |
ppwszPassword: *mut PCWSTR, |
| 7312 |
ppIdentifier: *mut PCRYPT_DATA_BLOB, |
| 7313 |
) -> BOOL} |
| 7314 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_RELEASE( |
| 7315 |
dwReason: DWORD, |
| 7316 |
pPluginContext: LPVOID, |
| 7317 |
) -> ()} |
| 7318 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_PASSWORD( |
| 7319 |
pPluginContext: LPVOID, |
| 7320 |
pwszPassword: PCWSTR, |
| 7321 |
) -> ()} |
| 7322 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE( |
| 7323 |
pPluginContext: LPVOID, |
| 7324 |
pbData: PBYTE, |
| 7325 |
) -> ()} |
| 7326 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_IDENTIFIER( |
| 7327 |
pPluginContext: LPVOID, |
| 7328 |
pIdentifier: PCRYPT_DATA_BLOB, |
| 7329 |
) -> ()} |
| 7330 |
STRUCT!{struct CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE { |
| 7331 |
cbSize: DWORD, |
| 7332 |
pfnGet: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_GET, |
| 7333 |
pfnRelease: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_RELEASE, |
| 7334 |
pfnFreePassword: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_PASSWORD, |
| 7335 |
pfnFree: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE, |
| 7336 |
pfnFreeIdentifier: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FREE_IDENTIFIER, |
| 7337 |
}} |
| 7338 |
pub type PCRYPT_OBJECT_LOCATOR_PROVIDER_TABLE = *mut CRYPT_OBJECT_LOCATOR_PROVIDER_TABLE; |
| 7339 |
FN!{stdcall PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_INITIALIZE( |
| 7340 |
pfnFlush: PFN_CRYPT_OBJECT_LOCATOR_PROVIDER_FLUSH, |
| 7341 |
pContext: LPVOID, |
| 7342 |
pdwExpectedObjectCount: *mut DWORD, |
| 7343 |
ppFuncTable: *mut PCRYPT_OBJECT_LOCATOR_PROVIDER_TABLE, |
| 7344 |
ppPluginContext: *mut *mut c_void, |
| 7345 |
) -> BOOL} |
| 7346 |
extern "system" { |
| 7347 |
pub fn CertIsWeakHash( |
| 7348 |
dwHashUseType: DWORD, |
| 7349 |
pwszCNGHashAlgid: LPCWSTR, |
| 7350 |
dwChainFlags: DWORD, |
| 7351 |
pSignerChainContext: PCCERT_CHAIN_CONTEXT, |
| 7352 |
pTimeStamp: LPFILETIME, |
| 7353 |
pwszFileName: LPCWSTR, |
| 7354 |
) -> BOOL; |
| 7355 |
} |
| 7356 |
FN!{stdcall PFN_CERT_IS_WEAK_HASH( |
| 7357 |
dwHashUseType: DWORD, |
| 7358 |
pwszCNGHashAlgid: LPCWSTR, |
| 7359 |
dwChainFlags: DWORD, |
| 7360 |
pSignerChainContext: PCCERT_CHAIN_CONTEXT, |
| 7361 |
pTimeStamp: LPFILETIME, |
| 7362 |
pwszFileName: LPCWSTR, |
| 7363 |
) -> BOOL} |
| 7364 |
pub const CERT_FILE_HASH_USE_TYPE: DWORD = 1; |
| 7365 |
pub const CERT_TIMESTAMP_HASH_USE_TYPE: DWORD = 2; |