CoseMultiSignMessage.TrySignDetached 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_Sign message with detached content into the specified buffer.
public static bool TrySignDetached (ReadOnlySpan<byte> detachedContent, Span<byte> destination, System.Security.Cryptography.Cose.CoseSigner signer, out int bytesWritten, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default, ReadOnlySpan<byte> associatedData = default);
static member TrySignDetached : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.Cose.CoseSigner * int * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap * ReadOnlySpan<byte> -> bool
Public Shared Function TrySignDetached (detachedContent As ReadOnlySpan(Of Byte), destination As Span(Of Byte), signer As CoseSigner, ByRef bytesWritten As Integer, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Boolean
Parameters
- detachedContent
- ReadOnlySpan<Byte>
The content to sign.
- signer
- CoseSigner
The signer information used to sign detachedContent
.
- bytesWritten
- Int32
On success, receives the number of bytes written to destination
.
- protectedHeaders
- CoseHeaderMap
The protected header parameters to append to the message's content layer.
- unprotectedHeaders
- CoseHeaderMap
The unprotected header parameters to append to the message's content layer.
- 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 have one or more labels in common.
-or-
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.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기