CoseMultiSignMessage.SignEmbedded 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
對指定內容進行簽名,並將其編碼為帶有內嵌內容的COSE_Sign訊息。
多載
| 名稱 | Description |
|---|---|
| SignEmbedded(Byte[], CoseSigner, CoseHeaderMap, CoseHeaderMap, Byte[]) |
對指定內容進行簽名,並將其編碼為帶有內嵌內容的COSE_Sign訊息。 |
| SignEmbedded(ReadOnlySpan<Byte>, CoseSigner, CoseHeaderMap, CoseHeaderMap, ReadOnlySpan<Byte>) |
對指定內容進行簽名,並將其編碼為帶有分離內容的COSE_Sign訊息。 |
SignEmbedded(Byte[], CoseSigner, CoseHeaderMap, CoseHeaderMap, Byte[])
對指定內容進行簽名,並將其編碼為帶有內嵌內容的COSE_Sign訊息。
public static byte[] SignEmbedded(byte[] embeddedContent, System.Security.Cryptography.Cose.CoseSigner signer, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default, byte[]? associatedData = default);
static member SignEmbedded : byte[] * System.Security.Cryptography.Cose.CoseSigner * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap * byte[] -> byte[]
Public Shared Function SignEmbedded (embeddedContent As Byte(), signer As CoseSigner, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing, Optional associatedData As Byte() = Nothing) As Byte()
參數
- embeddedContent
- Byte[]
要簽署並包含在訊息中的內容。
- signer
- CoseSigner
簽署者資訊用於簽署 embeddedContent。
- protectedHeaders
- CoseHeaderMap
受保護標頭參數可附加到訊息內容層。
- unprotectedHeaders
- CoseHeaderMap
未受保護的標頭參數可附加到訊息內容層。
- associatedData
- Byte[]
與簽名相關的額外資料,這些資料也必須在驗證時提供。
傳回
那個加密訊息。
例外狀況
embeddedContent 或 signer 為 null。
protectedHeaders這些 和 unprotectedHeaders 系列有一個或多個標籤是共同的。
-或-
ProtectedHeaders
UnprotectedHeaders與 系列signer在 中有一個或多個標籤是共同的。
-或-
標頭中指定的 CriticalHeaders 一個或多個標籤缺失。
適用於
SignEmbedded(ReadOnlySpan<Byte>, CoseSigner, CoseHeaderMap, CoseHeaderMap, ReadOnlySpan<Byte>)
對指定內容進行簽名,並將其編碼為帶有分離內容的COSE_Sign訊息。
public static byte[] SignEmbedded(ReadOnlySpan<byte> embeddedContent, System.Security.Cryptography.Cose.CoseSigner signer, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default, ReadOnlySpan<byte> associatedData = default);
static member SignEmbedded : ReadOnlySpan<byte> * System.Security.Cryptography.Cose.CoseSigner * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap * ReadOnlySpan<byte> -> byte[]
Public Shared Function SignEmbedded (embeddedContent As ReadOnlySpan(Of Byte), signer As CoseSigner, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Byte()
參數
- embeddedContent
- ReadOnlySpan<Byte>
要簽署並包含在訊息中的內容。
- signer
- CoseSigner
簽署者資訊用於簽署 embeddedContent。
- protectedHeaders
- CoseHeaderMap
受保護標頭參數可附加到訊息內容層。
- unprotectedHeaders
- CoseHeaderMap
未受保護的標頭參數可附加到訊息內容層。
- associatedData
- ReadOnlySpan<Byte>
與簽名相關的額外資料,這些資料也必須在驗證時提供。
傳回
那個加密訊息。
例外狀況
signer 是 null。
protectedHeaders這些 和 unprotectedHeaders 系列有一個或多個標籤是共同的。
-或-
ProtectedHeaders
UnprotectedHeaders與 系列signer在 中有一個或多個標籤是共同的。
-或-
標頭中指定的 CriticalHeaders 一個或多個標籤缺失。