Export (0) Print
Expand All

HMAC.Create Method (String)

Updated: January 2011

Creates an instance of the specified implementation of a Hash-based Message Authentication Code (HMAC).

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function Create ( _
	algorithmName As String _
) As HMAC
'Usage
Dim algorithmName As String 
Dim returnValue As HMAC 

returnValue = HMAC.Create(algorithmName)

Parameters

algorithmName
Type: System.String

The HMAC implementation to use. The following table shows the valid values for the algorithmName 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

[T:System.Security.Cryptography. HMACRIPEMD160]

HMACSHA1

HMACSHA1

System.Security.Cryptography.HMACSHA1

[T:System.Security.Cryptography. HMACSHA1]

HMACSHA256

HMACSHA256

System.Security.Cryptography.HMACSHA256

HMACSHA256

HMACSHA384

HMACSHA384

System.Security.Cryptography.HMACSHA384

HMACSHA384

HMACSHA512

HMACSHA512

System.Security.Cryptography.HMACSHA512

HMACSHA512

MACTripleDES

[T:System.Security.Cryptography. MACTripleDES]

System.Security.Cryptography.MACTripleDES

MACTripleDES

Return Value

Type: System.Security.Cryptography.HMAC
A new instance of the specified HMAC implementation.

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0

Date

History

Reason

January 2011

Added list of algorithm names.

Customer feedback.

Community Additions

ADD
Show:
© 2014 Microsoft