CoseMultiSignMessage.SignDetached Method

Definition

Overloads

SignDetached(Byte[], CoseSigner, CoseHeaderMap, CoseHeaderMap, Byte[])

Signs the specified content and encodes it as a COSE_Sign message with detached content.

SignDetached(Stream, CoseSigner, CoseHeaderMap, CoseHeaderMap, ReadOnlySpan<Byte>)

Signs the specified content and encodes it as a COSE_Sign message with detached content.

SignDetached(ReadOnlySpan<Byte>, CoseSigner, CoseHeaderMap, CoseHeaderMap, ReadOnlySpan<Byte>)

Signs the specified content and encodes it as a COSE_Sign message with detached content.

SignDetached(Byte[], CoseSigner, CoseHeaderMap, CoseHeaderMap, Byte[])

Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs

Signs the specified content and encodes it as a COSE_Sign message with detached content.

public static byte[] SignDetached (byte[] detachedContent, 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 SignDetached : byte[] * System.Security.Cryptography.Cose.CoseSigner * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap * byte[] -> byte[]
Public Shared Function SignDetached (detachedContent As Byte(), signer As CoseSigner, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing, Optional associatedData As Byte() = Nothing) As Byte()

Parameters

detachedContent
Byte[]

The content to sign.

signer
CoseSigner

The signer information used to sign detachedContent.

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
Byte[]

The extra data associated with the signature, which must also be provided during verification.

Returns

Byte[]

The encoded message.

Exceptions

detachedContent or 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

SignDetached(Stream, CoseSigner, CoseHeaderMap, CoseHeaderMap, ReadOnlySpan<Byte>)

Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs

Signs the specified content and encodes it as a COSE_Sign message with detached content.

public static byte[] SignDetached (System.IO.Stream detachedContent, 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 SignDetached : System.IO.Stream * System.Security.Cryptography.Cose.CoseSigner * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap * ReadOnlySpan<byte> -> byte[]
Public Shared Function SignDetached (detachedContent As Stream, signer As CoseSigner, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing, Optional associatedData As ReadOnlySpan(Of Byte) = Nothing) As Byte()

Parameters

detachedContent
Stream

The content to sign.

signer
CoseSigner

The signer information used to sign detachedContent.

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

Byte[]

The encoded message.

Exceptions

detachedContent or signer is null.

detachedContent does not support reading or seeking.

-or-

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

SignDetached(ReadOnlySpan<Byte>, CoseSigner, CoseHeaderMap, CoseHeaderMap, ReadOnlySpan<Byte>)

Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs
Source:
CoseMultiSignMessage.cs

Signs the specified content and encodes it as a COSE_Sign message with detached content.

public static byte[] SignDetached (ReadOnlySpan<byte> detachedContent, 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 SignDetached : ReadOnlySpan<byte> * System.Security.Cryptography.Cose.CoseSigner * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap * ReadOnlySpan<byte> -> byte[]
Public Shared Function SignDetached (detachedContent 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()

Parameters

detachedContent
ReadOnlySpan<Byte>

The content to sign.

signer
CoseSigner

The signer information used to sign detachedContent.

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

Byte[]

The encoded message.

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