CoseSigner Constructors

Definition

Overloads

CoseSigner(AsymmetricAlgorithm, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap)

Initializes a new instance of the CoseSigner class.

CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap)

Initializes a new instance of the CoseSigner class.

CoseSigner(AsymmetricAlgorithm, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap)

Source:
CoseSigner.cs
Source:
CoseSigner.cs
Source:
CoseSigner.cs
Source:
CoseSigner.cs
Source:
CoseSigner.cs

Initializes a new instance of the CoseSigner class.

public CoseSigner (System.Security.Cryptography.AsymmetricAlgorithm key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default);
new System.Security.Cryptography.Cose.CoseSigner : System.Security.Cryptography.AsymmetricAlgorithm * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap -> System.Security.Cryptography.Cose.CoseSigner
Public Sub New (key As AsymmetricAlgorithm, hashAlgorithm As HashAlgorithmName, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing)

Parameters

key
AsymmetricAlgorithm

The private key to use for signing.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value for signing.

protectedHeaders
CoseHeaderMap

The collection of protected header parameters to append to the message when signing.

unprotectedHeaders
CoseHeaderMap

The collection of unprotected header parameters to append to the message when signing.

Exceptions

key is null.

key is RSA, use CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap) to specify a signature padding.

-or-

key is of an unsupported type.

-or-

protectedHeaders contains a value with the Algorithm label, but the value was incorrect based on the key and hashAlgorithm.

-or-

unprotectedHeaders specifies a value with the Algorithm label.

Remarks

For sign operations in CoseSign1Message, protectedHeaders and unprotectedHeaders are used as the buckets of the content (and only) layer. For sign operations in CoseMultiSignMessage, protectedHeaders and unprotectedHeaders are used as the buckets of the signature layer.

Applies to

CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap)

Source:
CoseSigner.cs
Source:
CoseSigner.cs
Source:
CoseSigner.cs
Source:
CoseSigner.cs
Source:
CoseSigner.cs

Initializes a new instance of the CoseSigner class.

public CoseSigner (System.Security.Cryptography.RSA key, System.Security.Cryptography.RSASignaturePadding signaturePadding, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default);
new System.Security.Cryptography.Cose.CoseSigner : System.Security.Cryptography.RSA * System.Security.Cryptography.RSASignaturePadding * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap -> System.Security.Cryptography.Cose.CoseSigner
Public Sub New (key As RSA, signaturePadding As RSASignaturePadding, hashAlgorithm As HashAlgorithmName, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing)

Parameters

key
RSA

The private key to use for signing.

signaturePadding
RSASignaturePadding

The padding mode to use when signing.

hashAlgorithm
HashAlgorithmName

The hash algorithm to use to create the hash value for signing.

protectedHeaders
CoseHeaderMap

The collection of protected header parameters to append to the message when signing.

unprotectedHeaders
CoseHeaderMap

The collection of unprotected header parameters to append to the message when signing.

Exceptions

key is null.

protectedHeaders contains a value with the Algorithm label, but the value was incorrect based on the key, signaturePadding and hashAlgorithm.

-or-

unprotectedHeaders specifies a value with the Algorithm label.

Remarks

For sign operations in CoseSign1Message, protectedHeaders and unprotectedHeaders are used as the header parameters of the content layer. For sign operations in CoseMultiSignMessage, protectedHeaders and unprotectedHeaders are used as the header parameters of the signature layer.

Applies to