147 references to Constants
mscorlib (147)
system\security\cryptography\cryptoapitransform.cs (4)
93
case
Constants
.KP_IV:
99
case
Constants
.KP_MODE:
106
case
Constants
.KP_MODE_BITS:
110
case
Constants
.KP_EFFECTIVE_KEYLEN:
system\security\cryptography\cryptoconfig.cs (35)
119
ht.Add("SHA",
Constants
.OID_OIWSEC_SHA1);
120
ht.Add("SHA1",
Constants
.OID_OIWSEC_SHA1);
121
ht.Add("System.Security.Cryptography.SHA1",
Constants
.OID_OIWSEC_SHA1);
124
ht.Add("System.Security.Cryptography.SHA1CryptoServiceProvider",
Constants
.OID_OIWSEC_SHA1);
125
ht.Add("System.Security.Cryptography.SHA1Cng",
Constants
.OID_OIWSEC_SHA1);
128
ht.Add("System.Security.Cryptography.SHA1Managed",
Constants
.OID_OIWSEC_SHA1);
129
ht.Add("SHA256",
Constants
.OID_OIWSEC_SHA256);
130
ht.Add("System.Security.Cryptography.SHA256",
Constants
.OID_OIWSEC_SHA256);
133
ht.Add("System.Security.Cryptography.SHA256CryptoServiceProvider",
Constants
.OID_OIWSEC_SHA256);
134
ht.Add("System.Security.Cryptography.SHA256Cng",
Constants
.OID_OIWSEC_SHA256);
137
ht.Add("System.Security.Cryptography.SHA256Managed",
Constants
.OID_OIWSEC_SHA256);
140
ht.Add("SHA384",
Constants
.OID_OIWSEC_SHA384);
141
ht.Add("System.Security.Cryptography.SHA384",
Constants
.OID_OIWSEC_SHA384);
142
ht.Add("System.Security.Cryptography.SHA384CryptoServiceProvider",
Constants
.OID_OIWSEC_SHA384);
143
ht.Add("System.Security.Cryptography.SHA384Cng",
Constants
.OID_OIWSEC_SHA384);
144
ht.Add("System.Security.Cryptography.SHA384Managed",
Constants
.OID_OIWSEC_SHA384);
145
ht.Add("SHA512",
Constants
.OID_OIWSEC_SHA512);
146
ht.Add("System.Security.Cryptography.SHA512",
Constants
.OID_OIWSEC_SHA512);
147
ht.Add("System.Security.Cryptography.SHA512CryptoServiceProvider",
Constants
.OID_OIWSEC_SHA512);
148
ht.Add("System.Security.Cryptography.SHA512Cng",
Constants
.OID_OIWSEC_SHA512);
149
ht.Add("System.Security.Cryptography.SHA512Managed",
Constants
.OID_OIWSEC_SHA512);
150
ht.Add("RIPEMD160",
Constants
.OID_OIWSEC_RIPEMD160);
151
ht.Add("System.Security.Cryptography.RIPEMD160",
Constants
.OID_OIWSEC_RIPEMD160);
152
ht.Add("System.Security.Cryptography.RIPEMD160Managed",
Constants
.OID_OIWSEC_RIPEMD160);
153
ht.Add("MD5",
Constants
.OID_RSA_MD5);
154
ht.Add("System.Security.Cryptography.MD5",
Constants
.OID_RSA_MD5);
155
ht.Add("System.Security.Cryptography.MD5CryptoServiceProvider",
Constants
.OID_RSA_MD5);
156
ht.Add("System.Security.Cryptography.MD5Managed",
Constants
.OID_RSA_MD5);
157
ht.Add("TripleDESKeyWrap",
Constants
.OID_RSA_SMIMEalgCMS3DESwrap);
158
ht.Add("RC2",
Constants
.OID_RSA_RC2CBC);
159
ht.Add("System.Security.Cryptography.RC2CryptoServiceProvider",
Constants
.OID_RSA_RC2CBC);
160
ht.Add("DES",
Constants
.OID_OIWSEC_desCBC);
161
ht.Add("System.Security.Cryptography.DESCryptoServiceProvider",
Constants
.OID_OIWSEC_desCBC);
162
ht.Add("TripleDES",
Constants
.OID_RSA_DES_EDE3_CBC);
163
ht.Add("System.Security.Cryptography.TripleDESCryptoServiceProvider",
Constants
.OID_RSA_DES_EDE3_CBC);
system\security\cryptography\descryptoserviceprovider.cs (5)
22
if (!Utils.HasAlgorithm(
Constants
.CALG_DES, 0))
92
rgArgIds[cArgs] =
Constants
.KP_MODE;
113
rgArgIds[cArgs] =
Constants
.KP_IV;
120
rgArgIds[cArgs] =
Constants
.KP_MODE_BITS;
126
return new CryptoAPITransform(
Constants
.CALG_DES, cArgs, rgArgIds,
system\security\cryptography\dsacryptoserviceprovider.cs (11)
56
: this(0, new CspParameters(
Constants
.PROV_DSS_DH, null, null, s_UseMachineKeyStore)) {
62
: this(dwKeySize, new CspParameters(
Constants
.PROV_DSS_DH, null, null, s_UseMachineKeyStore)) {
119
byte[] publicKey = (byte[]) Utils._GetKeyParameter(_safeKeyHandle,
Constants
.CLR_PUBLICKEYONLY);
137
byte[] keySize = (byte[]) Utils._GetKeyParameter(_safeKeyHandle,
Constants
.CLR_KEYLEN);
201
int blobType = includePrivateParameters ?
Constants
.PRIVATEKEYBLOB :
Constants
.PUBLICKEYBLOB;
224
Utils._ImportKey(Utils.StaticDssProvHandle,
Constants
.CALG_DSS_SIGN, (CspProviderFlags) 0, dsaCspObject, ref _safeKeyHandle);
233
Utils._ImportKey(_safeProvHandle,
Constants
.CALG_DSS_SIGN, _parameters.Flags, dsaCspObject, ref _safeKeyHandle);
320
return Utils.SignValue(_safeKeyHandle, _parameters.KeyNumber,
Constants
.CALG_DSS_SIGN, calgHash, rgbHash);
336
return Utils.VerifySign(_safeKeyHandle,
Constants
.CALG_DSS_SIGN, calgHash, rgbHash, rgbSignature);
389
if (keyBlob[0] !=
Constants
.PUBLICKEYBLOB)
system\security\cryptography\icspasymmetricalgorithm.cs (25)
41
if (m_parameters.ProviderType ==
Constants
.PROV_RSA_FULL || m_parameters.ProviderType ==
Constants
.PROV_RSA_AES)
42
m_parameters.KeyNumber =
Constants
.AT_KEYEXCHANGE;
43
else if (m_parameters.ProviderType ==
Constants
.PROV_DSS_DH)
44
m_parameters.KeyNumber =
Constants
.AT_SIGNATURE;
80
int hr = Utils._OpenCSP(m_parameters,
Constants
.CRYPT_SILENT, ref safeProvHandle);
81
if (hr !=
Constants
.S_OK)
84
string uniqueContainerName = (string) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber,
Constants
.CLR_UNIQUE_CONTAINER);
104
int hr = Utils._OpenCSP(m_parameters,
Constants
.CRYPT_SILENT, ref safeProvHandle);
105
if (hr !=
Constants
.S_OK)
108
byte[] isExportable = (byte[]) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber,
Constants
.CLR_EXPORTABLE);
121
uint flags =
Constants
.CRYPT_VERIFYCONTEXT;
123
if (hr !=
Constants
.S_OK)
126
byte[] isHardwareDevice = (byte[]) Utils._GetProviderParameter(safeProvHandle, parameters.KeyNumber,
Constants
.CLR_HARDWARE);
139
uint flags =
Constants
.CRYPT_VERIFYCONTEXT;
141
if (hr !=
Constants
.S_OK)
144
byte[] isRemovable = (byte[]) Utils._GetProviderParameter(safeProvHandle, parameters.KeyNumber,
Constants
.CLR_REMOVABLE);
155
int hr = Utils._OpenCSP(m_parameters,
Constants
.CRYPT_SILENT, ref safeProvHandle);
156
if (hr !=
Constants
.S_OK)
159
byte[] isAccessible = (byte[]) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber,
Constants
.CLR_ACCESSIBLE);
173
int hr = Utils._OpenCSP(m_parameters,
Constants
.CRYPT_SILENT, ref safeProvHandle);
174
if (hr !=
Constants
.S_OK)
177
byte[] isProtected = (byte[]) Utils._GetProviderParameter(safeProvHandle, m_parameters.KeyNumber,
Constants
.CLR_PROTECTED);
195
int hr = Utils._OpenCSP(m_parameters,
Constants
.CRYPT_SILENT, ref safeProvHandle);
196
if (hr !=
Constants
.S_OK)
system\security\cryptography\md5cryptoserviceprovider.cs (2)
35
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle,
Constants
.CALG_MD5);
56
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle,
Constants
.CALG_MD5);
system\security\cryptography\rc2cryptoserviceprovider.cs (7)
42
if (!Utils.HasAlgorithm(
Constants
.CALG_RC2, 0))
130
rgArgIds[cArgs] =
Constants
.KP_EFFECTIVE_KEYLEN;
140
rgArgIds[cArgs] =
Constants
.KP_MODE;
161
rgArgIds[cArgs] =
Constants
.KP_IV;
168
rgArgIds[cArgs] =
Constants
.KP_MODE_BITS;
173
if (!Utils.HasAlgorithm(
Constants
.CALG_RC2, keySizeValue))
177
return new CryptoAPITransform(
Constants
.CALG_RC2, cArgs, rgArgIds,
system\security\cryptography\rsacryptoserviceprovider.cs (15)
166
byte[] publicKey = (byte[]) Utils._GetKeyParameter(_safeKeyHandle,
Constants
.CLR_PUBLICKEYONLY);
184
byte[] keySize = (byte[]) Utils._GetKeyParameter(_safeKeyHandle,
Constants
.CLR_KEYLEN);
192
if (_parameters.KeyNumber ==
Constants
.AT_KEYEXCHANGE)
256
int blobType = includePrivateParameters ?
Constants
.PRIVATEKEYBLOB :
Constants
.PUBLICKEYBLOB;
286
Utils._ImportKey(Utils.StaticProvHandle,
Constants
.CALG_RSA_KEYX, (CspProviderFlags) 0, rsaCspObject, ref _safeKeyHandle);
297
Utils._ImportKey(_safeProvHandle,
Constants
.CALG_RSA_KEYX, _parameters.Flags, rsaCspObject, ref _safeKeyHandle);
363
return Utils.SignValue(_safeKeyHandle, _parameters.KeyNumber,
Constants
.CALG_RSA_SIGN, calgHash, rgbHash);
384
return Utils.VerifySign(_safeKeyHandle,
Constants
.CALG_RSA_SIGN, calgHash, rgbHash, rgbSignature);
492
if (keyBlob[0] !=
Constants
.PUBLICKEYBLOB)
557
return
Constants
.CALG_MD5;
559
return
Constants
.CALG_SHA1;
561
return
Constants
.CALG_SHA_256;
563
return
Constants
.CALG_SHA_384;
565
return
Constants
.CALG_SHA_512;
system\security\cryptography\sha1cryptoserviceprovider.cs (2)
27
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle,
Constants
.CALG_SHA1);
49
_safeHashHandle = Utils.CreateHash(Utils.StaticProvHandle,
Constants
.CALG_SHA1);
system\security\cryptography\tripledescryptoserviceprovider.cs (6)
22
if (!Utils.HasAlgorithm(
Constants
.CALG_3DES, 0))
70
int algid =
Constants
.CALG_3DES;
88
rgArgIds[cArgs] =
Constants
.KP_MODE;
109
rgArgIds[cArgs] =
Constants
.KP_IV;
116
rgArgIds[cArgs] =
Constants
.KP_MODE_BITS;
124
algid =
Constants
.CALG_3DES_112;
system\security\cryptography\utils.cs (28)
148
internal const int DefaultRsaProviderType =
Constants
.PROV_RSA_AES;
182
_safeDssProvHandle = CreateProvHandle(new CspParameters(
Constants
.PROV_DSS_DH), true);
210
if (hr !=
Constants
.S_OK) {
213
if ((parameters.Flags & CspProviderFlags.UseExistingKey) != 0 || (hr !=
Constants
.NTE_KEYSET_NOT_DEF && hr !=
Constants
.NTE_BAD_KEYSET && hr !=
Constants
.NTE_FILENOTFOUND))
345
Utils.ExportCspBlob(safeKeyHandle, includePrivateParameters ?
Constants
.PRIVATEKEYBLOB :
Constants
.PUBLICKEYBLOB, JitHelpers.GetObjectHandleOnStack(ref blob));
380
SetProviderParameter(TempFetchedProvHandle, parameters.KeyNumber,
Constants
.CLR_PP_CLIENT_HWND, pHwnd);
385
SetProviderParameter(TempFetchedProvHandle, parameters.KeyNumber,
Constants
.CLR_PP_PIN, szPassword);
399
if (hr !=
Constants
.S_OK) {
400
if ((parameters.Flags & CspProviderFlags.UseExistingKey) != 0 || hr !=
Constants
.NTE_NO_KEY)
407
byte[] algid = (byte[]) Utils._GetKeyParameter(TempFetchedKeyHandle,
Constants
.CLR_ALGID);
409
if ((keyType == CspAlgorithmType.Rsa && dwAlgId !=
Constants
.CALG_RSA_KEYX && dwAlgId !=
Constants
.CALG_RSA_SIGN) ||
410
(keyType == CspAlgorithmType.Dss && dwAlgId !=
Constants
.CALG_DSS_SIGN)) {
449
parameters = new CspParameters(keyType == CspAlgorithmType.Dss ?
Constants
.PROV_DSS_DH : DefaultRsaProviderType, null, null, defaultFlags);
456
parameters.KeyNumber = keyType == CspAlgorithmType.Dss ?
Constants
.AT_SIGNATURE :
Constants
.AT_KEYEXCHANGE;
457
else if (parameters.KeyNumber ==
Constants
.CALG_DSS_SIGN || parameters.KeyNumber ==
Constants
.CALG_RSA_SIGN)
458
parameters.KeyNumber =
Constants
.AT_SIGNATURE;
459
else if (parameters.KeyNumber ==
Constants
.CALG_RSA_KEYX)
460
parameters.KeyNumber =
Constants
.AT_KEYEXCHANGE;
1007
case
Constants
.OID_OIWSEC_SHA1:
1010
case
Constants
.OID_OIWSEC_SHA256:
1013
case
Constants
.OID_OIWSEC_SHA384:
1016
case
Constants
.OID_OIWSEC_SHA512:
system\security\cryptography\x509certificates\x509utils.cs (7)
184
if (String.Equals(oid,
Constants
.OID_OIWSEC_SHA256, StringComparison.Ordinal)) {
185
return
Constants
.CALG_SHA_256;
187
else if (String.Equals(oid,
Constants
.OID_OIWSEC_SHA384, StringComparison.Ordinal)) {
188
return
Constants
.CALG_SHA_384;
190
else if (String.Equals(oid,
Constants
.OID_OIWSEC_SHA512, StringComparison.Ordinal)) {
191
return
Constants
.CALG_SHA_512;
215
return
Constants
.CALG_SHA1;