CoseSign1Message.TrySignEmbedded 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試簽署指定內容,並將其編碼為帶有嵌入內容的 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>
要簽署並包含在訊息中的內容。
- signer
- CoseSigner
簽署者資訊用於簽署 embeddedContent。
- bytesWritten
- Int32
成功時,會收到寫入 destination的位元組數。
- associatedData
- ReadOnlySpan<Byte>
與簽名相關的額外資料,這些資料也必須在驗證時提供。
傳回
true 如果 destination 有足夠長度以接收編碼訊息;否則, false。
例外狀況
signer 是 null。