CryptoProviderFactory.CreateKeyedHashAlgorithm(Byte[], String) Method
Definition
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.
Returns a KeyedHashAlgorithm for a specific algorithm.
public virtual System.Security.Cryptography.KeyedHashAlgorithm CreateKeyedHashAlgorithm (byte[] keyBytes, string algorithm);
abstract member CreateKeyedHashAlgorithm : byte[] * string -> System.Security.Cryptography.KeyedHashAlgorithm
override this.CreateKeyedHashAlgorithm : byte[] * string -> System.Security.Cryptography.KeyedHashAlgorithm
Public Overridable Function CreateKeyedHashAlgorithm (keyBytes As Byte(), algorithm As String) As KeyedHashAlgorithm
Parameters
- keyBytes
- Byte[]
bytes to use to create the Keyed Hash.
- algorithm
- String
the name of the keyed hash algorithm to create.
Returns
Exceptions
thrown if algorithm
is null or empty.
thrown if Create(String, Object[]) returns a type that is not assignable from KeyedHashAlgorithm.
algorithm
is not supported.
Remarks
When finished with the KeyedHashAlgorithm call ReleaseHashAlgorithm(HashAlgorithm).
If CustomCryptoProvider is set and IsSupportedAlgorithm(String, Object[]) returns true. Create(String, Object[]) is called to obtain the KeyedHashAlgorithm.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for