SHA256.Create SHA256.Create SHA256.Create SHA256.Create Method

Definition

Allows specific implementations of this abstract class to be instantiated.

Overloads

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

Creates an instance of the default implementation of SHA256.

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

Creates an instance of a specified implementation of SHA256.

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

Creates an instance of the default implementation of SHA256.

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

A new instance of SHA256. On the .NET Framework, this method creates an instance of the SHA256Managed class if FIPS mode is not active; if FIPS mode is active, it creates an instance of the SHA256Cng class. On .NET Core, it returns an instance of a private class derived from SHA256.

Exceptions

On the .NET Framework 4.6.1 and earlier versions only: The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible.

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

Creates an instance of a specified implementation of SHA256.

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

The name of the specific implementation of SHA256 to be used.

Returns

A new instance of SHA256 using the specified implementation.

Exceptions

On the .NET Framework only: FIPS mode is enabled, but hashName requests SHA256Managed, which is not FIPS compatible.

Remarks

The .NET Framework includes the implementations and their associated hashName values:

Implementation hashName
SHA256Managed SHA256
SHA-256
System.Security.Cryptography.SHA256
SHA256Cng System.Security.Cryptography.SHA256Cng
SHA256CryptoServiceProvider System.Security.Cryptography.SHA256CryptoServiceProvider

Applies to