語言

CoseSign1Message.TrySignEmbedded 方法

定義

嘗試簽署指定內容,並將其編碼為帶有嵌入內容的 COSE_Sign1 訊息,並嵌入於指定緩衝區中。

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

參數

embeddedContent
ReadOnlySpan<Byte>

要簽署並包含在訊息中的內容。

destination
Span<Byte>

用來寫入編碼位元組的緩衝區。

signer
CoseSigner

簽署者資訊用於簽署 embeddedContent。

bytesWritten
Int32

成功時,會收到寫入 destination的位元組數。

associatedData
ReadOnlySpan<Byte>

與簽名相關的額外資料,這些資料也必須在驗證時提供。

傳回

true 如果 destination 有足夠長度以接收編碼訊息;否則, false。

例外狀況

signer 是 null。

ProtectedHeaders UnprotectedHeaders與 系列signer在 中有一個或多個標籤是共同的。

-或-

標頭中指定的 CriticalHeaders 一個或多個標籤缺失。

適用於