CoseSign1Message.VerifyDetached 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
VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[]) |
Verifies that the signature is valid for the content using the specified key. |
VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>) |
Verifies that the signature is valid for the content using the specified key. |
VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>) |
Verifies that the signature is valid for the content using the specified key. |
VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[])
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
Verifies that the signature is valid for the content using the specified key.
public bool VerifyDetached (System.Security.Cryptography.AsymmetricAlgorithm key, byte[] detachedContent, byte[]? associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.AsymmetricAlgorithm * byte[] * byte[] -> bool
Public Function VerifyDetached (key As AsymmetricAlgorithm, detachedContent As Byte(), Optional associatedData As Byte() = Nothing) As Boolean
Parameters
The public key that is associated with the private key that was used to sign the content.
- detachedContent
- Byte[]
The content that was previously signed.
- associatedData
- Byte[]
The extra data associated with the signature, which must match the value provided during signing.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
key
or detachedContent
is null
.
key
is of an unsupported type.
The content is embedded on this message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key
.
Applies to
VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>)
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
Verifies that the signature is valid for the content using the specified key.
public bool VerifyDetached (System.Security.Cryptography.AsymmetricAlgorithm key, System.IO.Stream detachedContent, ReadOnlySpan<byte> associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.AsymmetricAlgorithm * System.IO.Stream * ReadOnlySpan<byte> -> bool
Public Function VerifyDetached (key As AsymmetricAlgorithm, detachedContent As Stream, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
The public key that is associated with the private key that was used to sign the content.
- detachedContent
- Stream
The content that was previously signed.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must match the value provided during signing.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
key
or detachedContent
is null
.
key
is of an unsupported type.
-or-
detachedContent
does not support reading or seeking.
The content is embedded on this message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key
.
Applies to
VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)
- Source:
- CoseSign1Message.cs
- Source:
- CoseSign1Message.cs
Verifies that the signature is valid for the content using the specified key.
public bool VerifyDetached (System.Security.Cryptography.AsymmetricAlgorithm key, ReadOnlySpan<byte> detachedContent, ReadOnlySpan<byte> associatedData = default);
member this.VerifyDetached : System.Security.Cryptography.AsymmetricAlgorithm * ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Function VerifyDetached (key As AsymmetricAlgorithm, detachedContent As ReadOnlySpan(Of Byte), Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
The public key that is associated with the private key that was used to sign the content.
- detachedContent
- ReadOnlySpan<Byte>
The content that was previously signed.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must match the value provided during signing.
Returns
true
if the signature is valid; otherwise, false
.
Exceptions
key
is null
.
key
is of an unsupported type.
The content is embedded on this message, use an overload that uses embedded content.
ProtectedHeaders does not have a value for the Algorithm header.
-or-
The algorithm protected header was incorrectly formatted.
-or-
The algorithm protected header was not one of the values supported by this implementation.
-or-
The algorithm protected header doesn't match with the algorithms supported by the specified key
.