This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Allows specific implementations of this abstract class to be instantiated.
| Name | Description |
|---|---|
| Create() | Creates an instance of the default implementation ofSHA256. |
| Create(String) | Obsolete. Creates an instance of a specified implementation ofSHA256. |
Creates an instance of the default implementation ofSHA256.
public: static System::Security::Cryptography::SHA256 ^ Create();public static System.Security.Cryptography.SHA256 Create();static member Create : unit -> System.Security.Cryptography.SHA256Public Shared Function Create () As SHA256A new instance ofSHA256. On the .NET Framework, this method creates an instance of theSHA256Managed class if FIPS mode is not active; if FIPS mode is active, it creates an instance of theSHA256Cng class. On .NET Core, it returns an instance of a private class derived fromSHA256.
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.
Caution
Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.
Creates an instance of a specified implementation ofSHA256.
public: static System::Security::Cryptography::SHA256 ^ Create(System::String ^ hashName);[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")][System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]public static System.Security.Cryptography.SHA256? Create(string hashName);public static System.Security.Cryptography.SHA256? Create(string hashName);[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]public static System.Security.Cryptography.SHA256? Create(string hashName);public static System.Security.Cryptography.SHA256 Create(string hashName);[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>][<System.Obsolete("Cryptographic factory methods accepting an algorithm name are obsolete. Use the parameterless Create factory method on the algorithm type instead.", DiagnosticId="SYSLIB0045", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]static member Create : string -> System.Security.Cryptography.SHA256static member Create : string -> System.Security.Cryptography.SHA256[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")>]static member Create : string -> System.Security.Cryptography.SHA256Public Shared Function Create (hashName As String) As SHA256A new instance ofSHA256 using the specified implementation.
On the .NET Framework only: FIPS mode is enabled, buthashName requestsSHA256Managed, which is not FIPS compatible.
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 |
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?