⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 const.cs

📁 本源码为OpenNETCF源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
//==========================================================================================
//
//		OpenNETCF.Windows.Forms.Const
//		Copyright (c) 2003, OpenNETCF.org
//
//		This library is free software; you can redistribute it and/or modify it under 
//		the terms of the OpenNETCF.org Shared Source License.
//
//		This library is distributed in the hope that it will be useful, but 
//		WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
//		FITNESS FOR A PARTICULAR PURPOSE. See the OpenNETCF.org Shared Source License 
//		for more details.
//
//		You should have received a copy of the OpenNETCF.org Shared Source License 
//		along with this library; if not, email licensing@opennetcf.org to request a copy.
//
//		If you wish to contact the OpenNETCF Advisory Board to discuss licensing, please 
//		email licensing@opennetcf.org.
//
//		For general enquiries, email enquiries@opennetcf.org or visit our website at:
//		http://www.opennetcf.org
//
//		!!! A HUGE thank-you goes out to Casey Chesnut for supplying this class library !!!
//      !!! You can contact Casey at http://www.brains-n-brawn.com                      !!!
//
//==========================================================================================
using System;

namespace OpenNETCF.Security.Cryptography.NativeMethods
{
	[CLSCompliant(false)]
	public class Const
	{
		// Algorithm classes
		public const uint ALG_CLASS_ANY = (0);
		public const uint ALG_CLASS_SIGNATURE = (1 << 13);
		public const uint ALG_CLASS_MSG_ENCRYPT = (2 << 13);
		public const uint ALG_CLASS_DATA_ENCRYPT = (3 << 13);
		public const uint ALG_CLASS_HASH = (4 << 13);
		public const uint ALG_CLASS_KEY_EXCHANGE = (5 << 13);
		public const uint ALG_CLASS_ALL = (7 << 13);

		// Algorithm types
		public const uint ALG_TYPE_ANY = (0);
		public const uint ALG_TYPE_DSS = (1 << 9);
		public const uint ALG_TYPE_RSA = (2 << 9);
		public const uint ALG_TYPE_BLOCK = (3 << 9);
		public const uint ALG_TYPE_STREAM = (4 << 9);
		public const uint ALG_TYPE_DH = (5 << 9);
		public const uint ALG_TYPE_SECURECHANNEL = (6 << 9);

		// Generic sub-ids
		public const uint ALG_SID_ANY = (0);
		// Some RSA sub-ids
		public const uint ALG_SID_RSA_ANY = 0;
		public const uint ALG_SID_RSA_PKCS = 1;
		public const uint ALG_SID_RSA_MSATWORK = 2;
		public const uint ALG_SID_RSA_ENTRUST = 3;
		public const uint ALG_SID_RSA_PGP = 4;
		// Some DSS sub-ids
		public const uint ALG_SID_DSS_ANY = 0;
		public const uint ALG_SID_DSS_PKCS = 1;
		public const uint ALG_SID_DSS_DMS = 2;
		// Block cipher sub ids
		// DES sub_ids
		public const uint ALG_SID_DES = 1;
		public const uint ALG_SID_3DES = 3;
		public const uint ALG_SID_DESX = 4;
		public const uint ALG_SID_IDEA = 5;
		public const uint ALG_SID_CAST = 6;
		public const uint ALG_SID_SAFERSK64 = 7;
		public const uint ALG_SID_SAFERSK128 = 8;
		public const uint ALG_SID_3DES_112 = 9;
		public const uint ALG_SID_CYLINK_MEK = 12;
		public const uint ALG_SID_RC5 = 13;
		public const uint ALG_SID_AES_128 = 14;
		public const uint ALG_SID_AES_192 = 15;
		public const uint ALG_SID_AES_256 = 16;
		public const uint ALG_SID_AES = 17;
		// Fortezza sub-ids
		public const uint ALG_SID_SKIPJACK = 10;
		public const uint ALG_SID_TEK = 11;
		// RC2 sub-ids
		public const uint ALG_SID_RC2 = 2;
		// Stream cipher sub-ids
		public const uint ALG_SID_RC4 = 1;
		public const uint ALG_SID_SEAL = 2;
		// Diffie-Hellman sub-ids
		public const uint ALG_SID_DH_SANDF = 1;
		public const uint ALG_SID_DH_EPHEM = 2;
		public const uint ALG_SID_AGREED_KEY_ANY = 3;
		public const uint ALG_SID_KEA = 4;
		// Hash sub ids
		public const uint ALG_SID_MD2 = 1;
		public const uint ALG_SID_MD4 = 2;
		public const uint ALG_SID_MD5 = 3;
		public const uint ALG_SID_SHA = 4;
		public const uint ALG_SID_SHA1 = 4;
		public const uint ALG_SID_MAC = 5;
		public const uint ALG_SID_RIPEMD = 6;
		public const uint ALG_SID_RIPEMD160 = 7;
		public const uint ALG_SID_SSL3SHAMD5 = 8;
		public const uint ALG_SID_HMAC = 9;
		public const uint ALG_SID_TLS1PRF = 10;
		public const uint ALG_SID_HASH_REPLACE_OWF = 11;
		public const uint ALG_SID_SHA_256 = 12;
		public const uint ALG_SID_SHA_384 = 13;
		public const uint ALG_SID_SHA_512 = 14;
		// secure channel sub ids
		public const uint ALG_SID_SSL3_MASTER = 1;
		public const uint ALG_SID_SCHANNEL_MASTER_HASH = 2;
		public const uint ALG_SID_SCHANNEL_MAC_KEY = 3;
		public const uint ALG_SID_PCT1_MASTER = 4;
		public const uint ALG_SID_SSL2_MASTER = 5;
		public const uint ALG_SID_TLS1_MASTER = 6;
		public const uint ALG_SID_SCHANNEL_ENC_KEY = 7;
		// Our silly example sub-id
		public const uint ALG_SID_EXAMPLE = 80;

		// algorithm identifier definitions
		public const uint CALG_MD2 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD2);
		public const uint CALG_MD4 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD4);
		public const uint CALG_MD5 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MD5); //32771
		public const uint CALG_SHA = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA);
		public const uint CALG_SHA1 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA1);
		public const uint CALG_MAC = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_MAC);
		public const uint CALG_RSA_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY);
		public const uint CALG_DSS_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY);
		public const uint CALG_NO_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_ANY | ALG_SID_ANY);
		public const uint CALG_RSA_KEYX = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_RSA|ALG_SID_RSA_ANY);
		public const uint CALG_DES = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DES); //26113
		public const uint CALG_3DES_112 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3DES_112);
		public const uint CALG_3DES = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_3DES);
		public const uint CALG_DESX = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_DESX);
		public const uint CALG_RC2 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC2);
		public const uint CALG_RC4 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_RC4); //26625
		public const uint CALG_SEAL = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_STREAM|ALG_SID_SEAL);
		public const uint CALG_DH_SF = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_SANDF);
		public const uint CALG_DH_EPHEM = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_DH_EPHEM);
		public const uint CALG_AGREEDKEY_ANY = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_AGREED_KEY_ANY);
		public const uint CALG_KEA_KEYX = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_DH|ALG_SID_KEA);
		public const uint CALG_HUGHES_MD5 = (ALG_CLASS_KEY_EXCHANGE|ALG_TYPE_ANY|ALG_SID_MD5);
		public const uint CALG_SKIPJACK = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_SKIPJACK);
		public const uint CALG_TEK = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_TEK);
		public const uint CALG_CYLINK_MEK = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_CYLINK_MEK);
		public const uint CALG_SSL3_SHAMD5 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SSL3SHAMD5);
		public const uint CALG_SSL3_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SSL3_MASTER);
		public const uint CALG_SCHANNEL_MASTER_HASH = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_MASTER_HASH);
		public const uint CALG_SCHANNEL_MAC_KEY = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_MAC_KEY);
		public const uint CALG_SCHANNEL_ENC_KEY = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SCHANNEL_ENC_KEY);
		public const uint CALG_PCT1_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_PCT1_MASTER);
		public const uint CALG_SSL2_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_SSL2_MASTER);
		public const uint CALG_TLS1_MASTER = (ALG_CLASS_MSG_ENCRYPT|ALG_TYPE_SECURECHANNEL|ALG_SID_TLS1_MASTER);
		public const uint CALG_RC5 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_RC5);
		public const uint CALG_HMAC = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HMAC);
		public const uint CALG_TLS1PRF = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_TLS1PRF);
		public const uint CALG_HASH_REPLACE_OWF = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_HASH_REPLACE_OWF);
		public const uint CALG_AES_128 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_128);
		public const uint CALG_AES_192 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_192);
		public const uint CALG_AES_256 = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES_256);
		public const uint CALG_AES = (ALG_CLASS_DATA_ENCRYPT|ALG_TYPE_BLOCK|ALG_SID_AES);
		public const uint CALG_SHA_256 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_256);
		public const uint CALG_SHA_384 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_384);
		public const uint CALG_SHA_512 = (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512);

		// KP_MODE
		public const uint CRYPT_MODE_CBCI= 6;       // ANSI CBC Interleaved
		public const uint CRYPT_MODE_CFBP = 7;       // ANSI CFB Pipelined
		public const uint CRYPT_MODE_OFBP = 8;       // ANSI OFB Pipelined
		public const uint CRYPT_MODE_CBCOFM = 9;       // ANSI CBC + OF Masking
		public const uint CRYPT_MODE_CBCOFMI = 10;      // ANSI CBC + OFM Interleaved

		// resource number for signatures in the CSP
		public const uint SIGNATURE_RESOURCE_NUMBER	= 0x29A;

		// dwFlag definitions for CryptGenKey
		public const uint CRYPT_EXPORTABLE = 0x00000001;
		public const uint CRYPT_USER_PROTECTED = 0x00000002;
		public const uint CRYPT_CREATE_SALT	= 0x00000004;
		public const uint CRYPT_UPDATE_KEY = 0x00000008;
		public const uint CRYPT_NO_SALT = 0x00000010;
		public const uint CRYPT_PREGEN = 0x00000040;
		public const uint CRYPT_RECIPIENT = 0x00000010;
		public const uint CRYPT_INITIATOR = 0x00000040;
		public const uint CRYPT_ONLINE = 0x00000080;
		public const uint CRYPT_SF = 0x00000100;
		public const uint CRYPT_CREATE_IV = 0x00000200;
		public const uint CRYPT_KEK	= 0x00000400;
		public const uint CRYPT_DATA_KEY = 0x00000800;
		public const uint CRYPT_VOLATILE = 0x00001000;
		public const uint CRYPT_SGCKEY = 0x00002000;
		public const uint CRYPT_ARCHIVABLE = 0x00004000;

		public const uint RSA1024BIT_KEY = 0x04000000;

		// dwFlags definitions for CryptDeriveKey
		public const uint CRYPT_SERVER	= 0x00000400;

		public const uint KEY_LENGTH_MASK = 0xFFFF0000;

		// dwFlag definitions for CryptExportKey
		public const uint CRYPT_Y_ONLY = 0x00000001;
		public const uint CRYPT_SSL2_FALLBACK = 0x00000002;
		public const uint CRYPT_DESTROYKEY = 0x00000004;
		public const uint CRYPT_OAEP = 0x00000040;  // used with RSA encryptions/decryptions
		// CryptExportKey, CryptImportKey,
		// CryptEncrypt and CryptDecrypt

		public const uint CRYPT_BLOB_VER3 = 0x00000080;  // export version 3 of a blob type
		public const uint CRYPT_IPSEC_HMAC_KEY = 0x00000100;  // CryptImportKey only

		// dwFlags definitions for CryptDecrypt
		//  See also CRYPT_OAEP, above.
		//  Note, the following flag is not supported for CryptEncrypt
		public const uint CRYPT_DECRYPT_RSA_NO_PADDING_CHECK = 0x00000020;

		// dwFlags definitions for CryptCreateHash
		public const uint CRYPT_SECRETDIGEST = 0x00000001;

		// dwFlags definitions for CryptHashData
		public const uint CRYPT_OWF_REPL_LM_HASH = 0x00000001;  // this is only for the OWF replacement CSP

		// dwFlags definitions for CryptHashSessionKey
		public const uint CRYPT_LITTLE_ENDIAN = 0x00000001;

		// dwFlags definitions for CryptSignHash and CryptVerifySignature
		public const uint CRYPT_NOHASHOID = 0x00000001;
		public const uint CRYPT_TYPE2_FORMAT = 0x00000002;
		public const uint CRYPT_X931_FORMAT = 0x00000004;

		// exported key blob definitions
		public const uint SIMPLEBLOB = 0x1;
		public const uint PUBLICKEYBLOB = 0x6;
		public const uint PRIVATEKEYBLOB = 0x7;
		public const uint PLAINTEXTKEYBLOB = 0x8;
		public const uint OPAQUEKEYBLOB = 0x9;
		public const uint PUBLICKEYBLOBEX = 0xA;
		public const uint SYMMETRICWRAPKEYBLOB = 0xB;

		public const uint AT_KEYEXCHANGE = 1;
		public const uint AT_SIGNATURE = 2;

		public const uint CRYPT_USERDATA = 1;

		// dwParam
		public const uint KP_IV = 1;       // Initialization vector
		public const uint KP_SALT = 2;       // Salt value
		public const uint KP_PADDING = 3;       // Padding values
		public const uint KP_MODE = 4;       // Mode of the cipher
		public const uint KP_MODE_BITS = 5;       // Number of bits to feedback
		public const uint KP_PERMISSIONS = 6;       // Key permissions DWORD
		public const uint KP_ALGID = 7;       // Key algorithm
		public const uint KP_BLOCKLEN = 8;       // Block size of the cipher
		public const uint KP_KEYLEN = 9;       // Length of key in bits
		public const uint KP_SALT_EX = 10;      // Length of salt in bytes
		public const uint KP_P = 11;      // DSS/Diffie-Hellman P value
		public const uint KP_G = 12;      // DSS/Diffie-Hellman G value
		public const uint KP_Q = 13;      // DSS Q value
		public const uint KP_X = 14;      // Diffie-Hellman X value
		public const uint KP_Y = 15;      // Y value
		public const uint KP_RA = 16;      // Fortezza RA value
		public const uint KP_RB = 17;      // Fortezza RB value
		public const uint KP_INFO = 18;      // for putting information into an RSA envelope
		public const uint KP_EFFECTIVE_KEYLEN = 19;      // setting and getting RC2 effective key length
		public const uint KP_SCHANNEL_ALG = 20;      // for setting the Secure Channel algorithms
		public const uint KP_CLIENT_RANDOM = 21;      // for setting the Secure Channel client random data
		public const uint KP_SERVER_RANDOM = 22;      // for setting the Secure Channel server random data

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -