Επεξεργασία

Κοινή χρήση μέσω


CoseSignature.VerifyDetached Method

Definition

Overloads

VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[])

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

VerifyDetached(AsymmetricAlgorithm, Stream, ReadOnlySpan<Byte>)

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

VerifyDetached(AsymmetricAlgorithm, ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

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

VerifyDetached(AsymmetricAlgorithm, Byte[], Byte[])

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 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

key
AsymmetricAlgorithm

The private key 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 the associated 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:
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 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

key
AsymmetricAlgorithm

The private key 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 the associated 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:
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 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

key
AsymmetricAlgorithm

The private key 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 the associated 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