Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ OpenHmac()

HMAC System.Security.Cryptography.Rfc2898DeriveBytes.OpenHmac ( byte[] password)
inlineprivate

Definition at line 220 of file Rfc2898DeriveBytes.cs.

221 {
222 HashAlgorithmName hashAlgorithm = HashAlgorithm;
223 if (string.IsNullOrEmpty(hashAlgorithm.Name))
224 {
225 throw new CryptographicException(System.SR.Cryptography_HashAlgorithmNameNullOrEmpty);
226 }
227 if (hashAlgorithm == HashAlgorithmName.SHA1)
228 {
229 return new HMACSHA1(password);
230 }
231 if (hashAlgorithm == HashAlgorithmName.SHA256)
232 {
233 return new HMACSHA256(password);
234 }
235 if (hashAlgorithm == HashAlgorithmName.SHA384)
236 {
237 return new HMACSHA384(password);
238 }
239 if (hashAlgorithm == HashAlgorithmName.SHA512)
240 {
241 return new HMACSHA512(password);
242 }
243 throw new CryptographicException(System.SR.Format(System.SR.Cryptography_UnknownHashAlgorithm, hashAlgorithm.Name));
244 }
static string Cryptography_UnknownHashAlgorithm
Definition SR.cs:152
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Cryptography_HashAlgorithmNameNullOrEmpty
Definition SR.cs:60
Definition SR.cs:7

References System.SR.Cryptography_HashAlgorithmNameNullOrEmpty, System.SR.Cryptography_UnknownHashAlgorithm, System.SR.Format(), System.Security.Cryptography.Rfc2898DeriveBytes.HashAlgorithm, System.Security.Cryptography.HashAlgorithmName.Name, System.Security.Cryptography.HashAlgorithmName.SHA1, System.Security.Cryptography.HashAlgorithmName.SHA256, System.Security.Cryptography.HashAlgorithmName.SHA384, and System.Security.Cryptography.HashAlgorithmName.SHA512.

Referenced by System.Security.Cryptography.Rfc2898DeriveBytes.Rfc2898DeriveBytes(), and System.Security.Cryptography.Rfc2898DeriveBytes.Rfc2898DeriveBytes().