📄 const.cs
字号:
public const uint KP_RP = 23;
public const uint KP_PRECOMP_MD5 = 24;
public const uint KP_PRECOMP_SHA = 25;
public const uint KP_CERTIFICATE = 26; // for setting Secure Channel certificate data (PCT1)
public const uint KP_CLEAR_KEY = 27; // for setting Secure Channel clear key data (PCT1)
public const uint KP_PUB_EX_LEN = 28;
public const uint KP_PUB_EX_VAL = 29;
public const uint KP_KEYVAL = 30;
public const uint KP_ADMIN_PIN = 31;
public const uint KP_KEYEXCHANGE_PIN = 32;
public const uint KP_SIGNATURE_PIN = 33;
public const uint KP_PREHASH = 34;
public const uint KP_ROUNDS = 35;
public const uint KP_OAEP_PARAMS = 36; // for setting OAEP params on RSA keys
public const uint KP_CMS_KEY_INFO = 37;
public const uint KP_CMS_DH_KEY_INFO = 38;
public const uint KP_PUB_PARAMS = 39; // for setting public parameters
public const uint KP_VERIFY_PARAMS = 40; // for verifying DSA and DH parameters
public const uint KP_HIGHEST_VERSION = 41; // for TLS protocol version setting
public const uint KP_GET_USE_COUNT = 42; // for use with PP_CRYPT_COUNT_KEY_USE contexts
// KP_PADDING
public const uint PKCS5_PADDING = 1; // PKCS 5 (sec 6.2) padding method
public const uint RANDOM_PADDING = 2;
public const uint ZERO_PADDING = 3;
// KP_MODE
public const uint CRYPT_MODE_CBC = 1; // Cipher block chaining
public const uint CRYPT_MODE_ECB = 2; // Electronic code book
public const uint CRYPT_MODE_OFB = 3; // Output feedback mode
public const uint CRYPT_MODE_CFB = 4; // Cipher feedback mode
public const uint CRYPT_MODE_CTS = 5; // Ciphertext stealing mode
// KP_PERMISSIONS
public const uint CRYPT_ENCRYPT = 0x0001; // Allow encryption
public const uint CRYPT_DECRYPT = 0x0002; // Allow decryption
public const uint CRYPT_EXPORT = 0x0004; // Allow key to be exported
public const uint CRYPT_READ = 0x0008; // Allow parameters to be read
public const uint CRYPT_WRITE = 0x0010; // Allow parameters to be set
public const uint CRYPT_MAC = 0x0020; // Allow MACs to be used with key
public const uint CRYPT_EXPORT_KEY = 0x0040; // Allow key to be used for exporting keys
public const uint CRYPT_IMPORT_KEY = 0x0080; // Allow key to be used for importing keys
public const uint CRYPT_ARCHIVE = 0x0100; // Allow key to be exported at creation only
public const uint HP_ALGID = 0x0001; // Hash algorithm
public const uint HP_HASHVAL = 0x0002; // Hash value
public const uint HP_HASHSIZE = 0x0004; // Hash value size
public const uint HP_HMAC_INFO = 0x0005; // information for creating an HMAC
public const uint HP_TLS1PRF_LABEL = 0x0006; // label for TLS1 PRF
public const uint HP_TLS1PRF_SEED = 0x0007; // seed for TLS1 PRF
public const uint CRYPT_FAILED = 0; //FALSE
public const uint CRYPT_SUCCEED = 1; //TRUE
public const uint CRYPT_FIRST = 1;
public const uint CRYPT_NEXT = 2;
public const uint CRYPT_SGC_ENUM = 4;
public const uint CRYPT_IMPL_HARDWARE = 1;
public const uint CRYPT_IMPL_SOFTWARE = 2;
public const uint CRYPT_IMPL_MIXED = 3;
public const uint CRYPT_IMPL_UNKNOWN = 4;
public const uint CRYPT_IMPL_REMOVABLE = 8;
// key storage flags
public const uint CRYPT_SEC_DESCR = 0x00000001;
public const uint CRYPT_PSTORE = 0x00000002;
public const uint CRYPT_UI_PROMPT = 0x00000004;
// protocol flags
public const uint CRYPT_FLAG_PCT1 = 0x0001;
public const uint CRYPT_FLAG_SSL2 = 0x0002;
public const uint CRYPT_FLAG_SSL3 = 0x0004;
public const uint CRYPT_FLAG_TLS1 = 0x0008;
public const uint CRYPT_FLAG_IPSEC = 0x0010;
public const uint CRYPT_FLAG_SIGNING = 0x0020;
// SGC flags
public const uint CRYPT_SGC = 0x0001;
public const uint CRYPT_FASTSGC = 0x0002;
//
// CryptSetProvParam
//
public const uint PP_CLIENT_HWND = 1;
public const uint PP_CONTEXT_INFO = 11;
public const uint PP_KEYEXCHANGE_KEYSIZE = 12;
public const uint PP_SIGNATURE_KEYSIZE = 13;
public const uint PP_KEYEXCHANGE_ALG = 14;
public const uint PP_SIGNATURE_ALG = 15;
public const uint PP_DELETEKEY = 24;
//max for CSP and container names
public const uint MAXUIDLEN = 64;
// Exponentiation Offload Reg Location
public const string EXPO_OFFLOAD_REG_VALUE = "ExpoOffload";
public const string EXPO_OFFLOAD_FUNC_NAME = "OffloadModExpo";
//
// Registry key in which the following private key-related
// values are created.
//
public const string szKEY_CRYPTOAPI_PRIVATE_KEY_OPTIONS = "Software\\Policies\\Microsoft\\Cryptography" ;
//
// Registry value for controlling Data Protection API (DPAPI) UI settings.
//
public const string szFORCE_KEY_PROTECTION = "ForceKeyProtection";
public const uint dwFORCE_KEY_PROTECTION_DISABLED = 0x0;
public const uint dwFORCE_KEY_PROTECTION_USER_SELECT = 0x1;
public const uint dwFORCE_KEY_PROTECTION_HIGH = 0x2;
//
// Registry values for enabling and controlling the caching (and timeout)
// of private keys. This feature is useful only for UI-protected private
// keys.
//
// Note that in Windows 2000 and later, private keys, once read from storage,
// are cached in the associated HCRYPTPROV structure for subsequent use.
//
// In .NET Server and XP SP1, new key caching behavior is available. Keys
// that have been read from storage and cached may now be considered "stale"
// if a period of time has elapsed since the key was last used. This forces
// the key to be re-read from storage (which will make the DPAPI UI appear
// again).
//
// To enable the new behavior, create the registry DWORD value
// szKEY_CACHE_ENABLED and set it to 1. The registry DWORD value
// szKEY_CACHE_SECONDS must also be created and set to the number of seconds
// that a cached private key may still be considered usable.
//
public const string szKEY_CACHE_ENABLED = "CachePrivateKeys";
public const string szKEY_CACHE_SECONDS = "PrivateKeyLifetimeSeconds";
public const uint CUR_BLOB_VERSION = 2;
// uses of algortihms for SCHANNEL_ALG structure
public const uint SCHANNEL_MAC_KEY = 0x00000000;
public const uint SCHANNEL_ENC_KEY = 0x00000001;
// uses of dwFlags SCHANNEL_ALG structure
public const uint INTERNATIONAL_USAGE = 0x00000001;
public const string MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0";
public const string MS_ENHANCED_PROV = "Microsoft Enhanced Cryptographic Provider v1.0";
public const string MS_STRONG_PROV = "Microsoft Strong Cryptographic Provider";
public const string MS_DEF_RSA_SIG_PROV = "Microsoft RSA Signature Cryptographic Provider";
public const string MS_DEF_RSA_SCHANNEL_PROV = "Microsoft RSA SChannel Cryptographic Provider";
public const string MS_DEF_DSS_PROV = "Microsoft Base DSS Cryptographic Provider";
public const string MS_DEF_DSS_DH_PROV = "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider";
public const string MS_ENH_DSS_DH_PROV = "Microsoft Enhanced DSS and Diffie-Hellman Cryptographic Provider";
public const string MS_DEF_DH_SCHANNEL_PROV = "Microsoft DH SChannel Cryptographic Provider";
public const string MS_SCARD_PROV = "Microsoft Base Smart Card Crypto Provider";
public const string MS_ENH_RSA_AES_PROV = "Microsoft Enhanced RSA and AES Cryptographic Provider";
// CryptGetProvParam
public const uint PP_ENUMALGS = 1;
public const uint PP_ENUMCONTAINERS = 2;
public const uint PP_IMPTYPE = 3;
public const uint PP_NAME = 4;
public const uint PP_VERSION = 5;
public const uint PP_CONTAINER = 6;
public const uint PP_CHANGE_PASSWORD = 7;
public const uint PP_KEYSET_SEC_DESCR = 8; // get/set security descriptor of keyset
public const uint PP_CERTCHAIN = 9; // for retrieving certificates from tokens
public const uint PP_KEY_TYPE_SUBTYPE = 10;
public const uint PP_PROVTYPE = 16;
public const uint PP_KEYSTORAGE = 17;
public const uint PP_APPLI_CERT = 18;
public const uint PP_SYM_KEYSIZE = 19;
public const uint PP_SESSION_KEYSIZE = 20;
public const uint PP_UI_PROMPT = 21;
public const uint PP_ENUMALGS_EX = 22;
public const uint PP_ENUMMANDROOTS = 25;
public const uint PP_ENUMELECTROOTS = 26;
public const uint PP_KEYSET_TYPE = 27;
public const uint PP_ADMIN_PIN = 31;
public const uint PP_KEYEXCHANGE_PIN = 32;
public const uint PP_SIGNATURE_PIN = 33;
public const uint PP_SIG_KEYSIZE_INC = 34;
public const uint PP_KEYX_KEYSIZE_INC = 35;
public const uint PP_UNIQUE_CONTAINER = 36;
public const uint PP_SGC_INFO = 37;
public const uint PP_USE_HARDWARE_RNG = 38;
public const uint PP_KEYSPEC = 39;
public const uint PP_ENUMEX_SIGNING_PROT = 40;
public const uint PP_CRYPT_COUNT_KEY_USE = 41;
// dwFlags definitions for CryptAcquireContext
public const uint CRYPT_VERIFYCONTEXT = 0xF0000000;
public const uint CRYPT_NEWKEYSET = 0x00000008;
public const uint CRYPT_DELETEKEYSET = 0x00000010;
public const uint CRYPT_MACHINE_KEYSET = 0x00000020;
public const uint CRYPT_SILENT = 0x00000040;
// dwFlag definitions for CryptSetProviderEx and CryptGetDefaultProvider
public const uint CRYPT_MACHINE_DEFAULT = 0x00000001;
public const uint CRYPT_USER_DEFAULT = 0x00000002;
public const uint CRYPT_DELETE_DEFAULT = 0x00000004;
public const uint PROV_RSA_FULL = 1;
public const uint PROV_RSA_SIG = 2;
public const uint PROV_DSS = 3;
public const uint PROV_FORTEZZA = 4;
public const uint PROV_MS_EXCHANGE = 5;
public const uint PROV_SSL = 6;
public const uint PROV_RSA_SCHANNEL = 12;
public const uint PROV_DSS_DH = 13;
public const uint PROV_EC_ECDSA_SIG = 14;
public const uint PROV_EC_ECNRA_SIG = 15;
public const uint PROV_EC_ECDSA_FULL = 16;
public const uint PROV_EC_ECNRA_FULL = 17;
public const uint PROV_DH_SCHANNEL = 18;
public const uint PROV_SPYRUS_LYNKS = 20;
public const uint PROV_RNG = 21;
public const uint PROV_INTEL_SEC = 22;
public const uint PROV_REPLACE_OWF = 23;
public const uint PROV_RSA_AES = 24;
// base provider action
//{ 0xdf9d8cd0, 0x1501, 0x11d1, {0x8c, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb} }
//public const uint CRYPTPROTECT_DEFAULT_PROVIDER_INTERNAL = {0x8c, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0xeb};
//public const uint CRYPTPROTECT_DEFAULT_PROVIDER = { 0xdf9d8cd0, 0x1501, 0x11d1, CRYPTPROTECT_DEFAULT_PROVIDER_INTERNAL };
// CryptProtect PromptStruct dwPromtFlags
// prompt on unprotect
public const uint CRYPTPROTECT_PROMPT_ON_UNPROTECT = 0x1; // 1<<0
// prompt on protect
public const uint CRYPTPROTECT_PROMPT_ON_PROTECT = 0x2; // 1<<1
public const uint CRYPTPROTECT_PROMPT_RESERVED = 0x04; // reserved, do not use.
// default to strong variant UI protection (user supplied password currently).
public const uint CRYPTPROTECT_PROMPT_STRONG = 0x08; // 1<<3
// require strong variant UI protection (user supplied password currently).
public const uint CRYPTPROTECT_PROMPT_REQUIRE_STRONG = 0x10; // 1<<4
// CryptProtectData and CryptUnprotectData dwFlags
// for remote-access situations where ui is not an option
// if UI was specified on protect or unprotect operation, the call
// will fail and GetLastError() will indicate ERROR_PASSWORD_RESTRICTION
public const uint CRYPTPROTECT_UI_FORBIDDEN = 0x1;
// per machine protected data -- any user on machine where CryptProtectData
// took place may CryptUnprotectData
public const uint CRYPTPROTECT_LOCAL_MACHINE = 0x4;
// force credential synchronize during CryptProtectData()
// Synchronize is only operation that occurs during this operation
public const uint CRYPTPROTECT_CRED_SYNC = 0x8;
// Generate an Audit on protect and unprotect operations
public const uint CRYPTPROTECT_AUDIT = 0x10;
// Protect data with a non-recoverable key
public const uint CRYPTPROTECT_NO_RECOVERY = 0x20;
// Verify the protection of a protected blob
public const uint CRYPTPROTECT_VERIFY_PROTECTION = 0x40;
// Regenerate the local machine protection
public const uint CRYPTPROTECT_CRED_REGENERATE = 0x80;
// Only allow decryption from system (trusted) processes (Windows CE)
public const uint CRYPTPROTECT_SYSTEM = 0x20000000;
// flags reserved for system use
public const uint CRYPTPROTECT_FIRST_RESERVED_FLAGVAL = 0x0FFFFFFF;
public const uint CRYPTPROTECT_LAST_RESERVED_FLAGVAL = 0xFFFFFFFF;
//NOT FROM WinCrypt.h
//public const int MAX_KEYBLOB = 1024;
//public const uint MAX_HASH = 64;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -