Edit

Share via


CoseSignature.VerifyEmbedded Method

Definition

Overloads

VerifyEmbedded(AsymmetricAlgorithm, Byte[])

Verifies that the signature is valid for the message's content using the specified key.

VerifyEmbedded(AsymmetricAlgorithm, ReadOnlySpan<Byte>)

Verifies that the signature is valid for the message's content using the specified key.

VerifyEmbedded(AsymmetricAlgorithm, Byte[])

Source:
CoseSignature.cs
Source:
CoseSignature.cs
Source:
CoseSignature.cs
Source:
CoseSignature.cs

Verifies that the signature is valid for the message's content using the specified key.

public bool VerifyEmbedded (System.Security.Cryptography.AsymmetricAlgorithm key, byte[]? associatedData = default);
member this.VerifyEmbedded : System.Security.Cryptography.AsymmetricAlgorithm * byte[] -> bool
Public Function VerifyEmbedded (key As AsymmetricAlgorithm, Optional associatedData As Byte() = Nothing) As Boolean

Parameters

key
AsymmetricAlgorithm

The private key used to sign the content.

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 is null.

key is of an unsupported type.

The content is detached from the associated message, use an overload that accepts a detached 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

VerifyEmbedded(AsymmetricAlgorithm, ReadOnlySpan<Byte>)

Source:
CoseSignature.cs
Source:
CoseSignature.cs
Source:
CoseSignature.cs
Source:
CoseSignature.cs

Verifies that the signature is valid for the message's content using the specified key.

public:
 bool VerifyEmbedded(System::Security::Cryptography::AsymmetricAlgorithm ^ key, ReadOnlySpan<System::Byte> associatedData);
public bool VerifyEmbedded (System.Security.Cryptography.AsymmetricAlgorithm key, ReadOnlySpan<byte> associatedData);
member this.VerifyEmbedded : System.Security.Cryptography.AsymmetricAlgorithm * ReadOnlySpan<byte> -> bool
Public Function VerifyEmbedded (key As AsymmetricAlgorithm, associatedData As ReadOnlySpan(Of Byte)) As Boolean

Parameters

key
AsymmetricAlgorithm

The private key used to sign the content.

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 detached from the associated message, use an overload that accepts a detached 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