SlhDsa.VerifyPreHash 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.
Overloads
| VerifyPreHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, String, ReadOnlySpan<Byte>) |
Verifies that the specified FIPS 205 pre-hash signature is valid for this key and the provided hash. |
| VerifyPreHash(Byte[], Byte[], String, Byte[]) |
Verifies that the specified FIPS 205 pre-hash signature is valid for this key and the provided hash. |
VerifyPreHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, String, ReadOnlySpan<Byte>)
- Source:
- SlhDsa.cs
Verifies that the specified FIPS 205 pre-hash signature is valid for this key and the provided hash.
public bool VerifyPreHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, string hashAlgorithmOid, ReadOnlySpan<byte> context = default);
member this.VerifyPreHash : ReadOnlySpan<byte> * ReadOnlySpan<byte> * string * ReadOnlySpan<byte> -> bool
Public Function VerifyPreHash (hash As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte), hashAlgorithmOid As String, Optional context As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
- hash
- ReadOnlySpan<Byte>
The hash to verify.
- signature
- ReadOnlySpan<Byte>
The signature to verify.
- hashAlgorithmOid
- String
The OID of the hash algorithm used to create the hash.
- context
- ReadOnlySpan<Byte>
The context value which was provided during signing.
The default value is an empty buffer.
Returns
true if the signature validates the hash; otherwise, false.
Exceptions
hashAlgorithmOid is null.
context has a Length in excess of 255 bytes.
This instance has been disposed.
hashAlgorithmOid is not a well-formed OID.
-or-
hashAlgorithmOid is a well-known algorithm and hash does not have the expected length.
-or-
An error occurred while verifying the hash.
Applies to
VerifyPreHash(Byte[], Byte[], String, Byte[])
- Source:
- SlhDsa.cs
Verifies that the specified FIPS 205 pre-hash signature is valid for this key and the provided hash.
public bool VerifyPreHash(byte[] hash, byte[] signature, string hashAlgorithmOid, byte[]? context = default);
member this.VerifyPreHash : byte[] * byte[] * string * byte[] -> bool
Public Function VerifyPreHash (hash As Byte(), signature As Byte(), hashAlgorithmOid As String, Optional context As Byte() = Nothing) As Boolean
Parameters
- hash
- Byte[]
The hash to verify.
- signature
- Byte[]
The signature to verify.
- hashAlgorithmOid
- String
The OID of the hash algorithm used to create the hash.
Returns
true if the signature validates the hash; otherwise, false.
Exceptions
hash or signature or hashAlgorithmOid is null.
context has a length in excess of 255 bytes.
This instance has been disposed.
hashAlgorithmOid is not a well-formed OID.
-or-
hashAlgorithmOid is a well-known algorithm and hash does not have the expected length.
-or-
An error occurred while verifying the hash.
Remarks
A null context is treated as empty.