KeyedHashAlgorithm.Create KeyedHashAlgorithm.Create KeyedHashAlgorithm.Create KeyedHashAlgorithm.Create Method

Definition

Creates an instance of an implementation of a keyed hash algorithm.

Overloads

Create() Create() Create() Create()

Creates an instance of the default implementation of a keyed hash algorithm.

Create(String) Create(String) Create(String) Create(String)

Creates an instance of the specified implementation of a keyed hash algorithm.

Create() Create() Create() Create()

Creates an instance of the default implementation of a keyed hash algorithm.

public:
 static System::Security::Cryptography::KeyedHashAlgorithm ^ Create();
public static System.Security.Cryptography.KeyedHashAlgorithm Create ();
static member Create : unit -> System.Security.Cryptography.KeyedHashAlgorithm
Public Shared Function Create () As KeyedHashAlgorithm

Returns

A new HMACSHA1 instance, unless the default settings have been changed.

Remarks

By default, this overload uses the HMACSHA1 implementation of a keyed hash algorithm. If you want to specify a different implementation, use the Create(String) overload, which lets you specify an algorithm name, instead. The cryptography configuration system defines the default implementation of the KeyedHashAlgorithm class.

Due to collision problems with SHA1, Microsoft recommends a security model based on SHA256 or better.

See also

Create(String) Create(String) Create(String) Create(String)

Creates an instance of the specified implementation of a keyed hash algorithm.

public:
 static System::Security::Cryptography::KeyedHashAlgorithm ^ Create(System::String ^ algName);
public static System.Security.Cryptography.KeyedHashAlgorithm Create (string algName);
static member Create : string -> System.Security.Cryptography.KeyedHashAlgorithm
Public Shared Function Create (algName As String) As KeyedHashAlgorithm

Parameters

algName
String String String String

The keyed hash algorithm implementation to use. The following table shows the valid values for the algName parameter and the algorithms they map to.

Parameter value Implements
System.Security.Cryptography.HMAC HMACSHA1
System.Security.Cryptography.KeyedHashAlgorithm HMACSHA1
HMACMD5 HMACMD5
System.Security.Cryptography.HMACMD5 HMACMD5
HMACRIPEMD160 HMACRIPEMD160
System.Security.Cryptography.HMACRIPEMD160 HMACRIPEMD160
HMACSHA1 HMACSHA1
System.Security.Cryptography.HMACSHA1 HMACSHA1
HMACSHA256 HMACSHA256
System.Security.Cryptography.HMACSHA256 HMACSHA256
HMACSHA384 HMACSHA384
System.Security.Cryptography.HMACSHA384 HMACSHA384
HMACSHA512 HMACSHA512
System.Security.Cryptography.HMACSHA512 HMACSHA512
MACTripleDES MACTripleDES
System.Security.Cryptography.MACTripleDES MACTripleDES

Returns

A new instance of the specified keyed hash algorithm.

Remarks

This method supports a number of algorithms, including MD5, SHA-1, SHA-256, and RIPEMD160. For a full list, see the supported values for the algName parameter.

See also

Applies to