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。