CoseSign1Message.TrySignEmbedded 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.
Attempts to sign the specified content and encode it as a COSE_Sign1 message with embedded content into the specified buffer.
public static bool TrySignEmbedded (ReadOnlySpan<byte> embeddedContent, Span<byte> destination, System.Security.Cryptography.Cose.CoseSigner signer, out int bytesWritten, ReadOnlySpan<byte> associatedData = default);
static member TrySignEmbedded : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.Cose.CoseSigner * int * ReadOnlySpan<byte> -> bool
Public Shared Function TrySignEmbedded (embeddedContent As ReadOnlySpan(Of Byte), destination As Span(Of Byte), signer As CoseSigner, ByRef bytesWritten As Integer, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
- embeddedContent
- ReadOnlySpan<Byte>
The content to sign and to include in the message.
- signer
- CoseSigner
The signer information used to sign embeddedContent
.
- bytesWritten
- Int32
On success, receives the number of bytes written to destination
.
- associatedData
- ReadOnlySpan<Byte>
The extra data associated with the signature, which must also be provided during verification.
Returns
true
if destination
had sufficient length to receive the encoded message; otherwise, false
.
Exceptions
signer
is null
.
The ProtectedHeaders and UnprotectedHeaders collections in signer
have one or more labels in common.
-or-
One or more of the labels specified in a CriticalHeaders header is missing.