Язык

CmsSigner Конструкторы

Определение

Инициализирует новый экземпляр класса CmsSigner.

Перегрузки

Имя Описание
CmsSigner()

Инициализирует новый экземпляр CmsSigner класса со значениями по умолчанию.

CmsSigner(SubjectIdentifierType, X509Certificate2, SlhDsa)
CmsSigner(SubjectIdentifierType, X509Certificate2, MLDsa)
CmsSigner(SubjectIdentifierType, X509Certificate2, CompositeMLDsa)
CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Инициализирует новый экземпляр класса с указанным сертификатом подписи, типом идентификатора субъекта и объектом закрытого CmsSigner ключа.

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Инициализирует новый экземпляр класса CmsSigner с указанным сертификатом подписи, типом идентификатора субъекта, объектом закрытого ключа и заполнением подписи RSA.

CmsSigner(X509Certificate2)

Инициализирует новый экземпляр CmsSigner класса с указанным сертификатом подписи.

CmsSigner(SubjectIdentifierType)

Инициализирует новый экземпляр CmsSigner класса с указанным типом идентификатора субъекта.

CmsSigner(CspParameters)
Устаревшие.

Инициализирует новый экземпляр CmsSigner класса из сохраненного ключа.

CmsSigner(SubjectIdentifierType, X509Certificate2)

Инициализирует новый экземпляр CmsSigner класса с указанным сертификатом подписи и типом идентификатора субъекта.

CmsSigner()

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Инициализирует новый экземпляр CmsSigner класса со значениями по умолчанию.

public:
 CmsSigner();
public CmsSigner();
Public Sub New ()

Комментарии

Этот конструктор приводит к следующим значениям свойств по умолчанию:

Недвижимость Значение по умолчанию
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Применяется к

CmsSigner(SubjectIdentifierType, X509Certificate2, SlhDsa)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::SlhDsa ^ privateKey);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.SlhDsa? privateKey);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.SlhDsa? privateKey);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.SlhDsa -> System.Security.Cryptography.Pkcs.CmsSigner
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.SlhDsa -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType, certificate As X509Certificate2, privateKey As SlhDsa)

Параметры

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
SlhDsa
Атрибуты

Применяется к

CmsSigner(SubjectIdentifierType, X509Certificate2, MLDsa)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::MLDsa ^ privateKey);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.MLDsa? privateKey);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.MLDsa? privateKey);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.MLDsa -> System.Security.Cryptography.Pkcs.CmsSigner
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.MLDsa -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType, certificate As X509Certificate2, privateKey As MLDsa)

Параметры

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
MLDsa
Атрибуты

Применяется к

CmsSigner(SubjectIdentifierType, X509Certificate2, CompositeMLDsa)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::CompositeMLDsa ^ privateKey);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.CompositeMLDsa? privateKey);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.CompositeMLDsa? privateKey);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.CompositeMLDsa -> System.Security.Cryptography.Pkcs.CmsSigner
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.CompositeMLDsa -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType, certificate As X509Certificate2, privateKey As CompositeMLDsa)

Параметры

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
CompositeMLDsa
Атрибуты

Применяется к

CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Инициализирует новый экземпляр класса с указанным сертификатом подписи, типом идентификатора субъекта и объектом закрытого CmsSigner ключа.

public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::AsymmetricAlgorithm ^ privateKey);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.AsymmetricAlgorithm? privateKey);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate, System.Security.Cryptography.AsymmetricAlgorithm privateKey);
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.AsymmetricAlgorithm -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType, certificate As X509Certificate2, privateKey As AsymmetricAlgorithm)

Параметры

signerIdentifierType
SubjectIdentifierType

Одно из значений перечисления, указывающее схему, используемую для определения используемого сертификата подписи.

certificate
X509Certificate2

Сертификат, закрытый ключ которого будет использоваться для подписи сообщения.

privateKey
AsymmetricAlgorithm

Объект закрытого ключа, используемый при подписи сообщения.

Комментарии

Этот конструктор приводит к следующим значениям свойств по умолчанию:

Недвижимость Значение по умолчанию
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None If SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot иначе

Сертификат подписи, указанный параметром certificate , не проверяется на допустимость входных данных. Чтобы проверить сертификат перед его предоставлением этому конструктору, используйте X509Chain.Build метод.

Этот конструктор не проверяет, соответствует ли privateKey параметр открытому ключу.certificate Если ключи не совпадают, SignedCms класс и ComputeCounterSignature(CmsSigner) метод вызывают CryptographicException во время процесса подписывания.

Применяется к

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Инициализирует новый экземпляр класса CmsSigner с указанным сертификатом подписи, типом идентификатора субъекта, объектом закрытого ключа и заполнением подписи RSA.

public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate, System::Security::Cryptography::RSA ^ privateKey, System::Security::Cryptography::RSASignaturePadding ^ signaturePadding);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate, System.Security.Cryptography.RSA? privateKey, System.Security.Cryptography.RSASignaturePadding? signaturePadding);
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 * System.Security.Cryptography.RSA * System.Security.Cryptography.RSASignaturePadding -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType, certificate As X509Certificate2, privateKey As RSA, signaturePadding As RSASignaturePadding)

Параметры

signerIdentifierType
SubjectIdentifierType

Одно из значений перечисления, указывающее схему, используемую для определения используемого сертификата подписи.

certificate
X509Certificate2

Сертификат, закрытый ключ которого будет использоваться для подписи сообщения.

privateKey
RSA

Объект закрытого ключа, используемый при подписи сообщения.

signaturePadding
RSASignaturePadding

Заполнение подписи RSA для использования.

Применяется к

CmsSigner(X509Certificate2)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Инициализирует новый экземпляр CmsSigner класса с указанным сертификатом подписи.

public:
 CmsSigner(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public CmsSigner(System.Security.Cryptography.X509Certificates.X509Certificate2? certificate);
public CmsSigner(System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (certificate As X509Certificate2)

Параметры

certificate
X509Certificate2

Сертификат, закрытый ключ которого будет использоваться для подписи сообщения.

Комментарии

Этот конструктор приводит к следующим значениям свойств по умолчанию:

Недвижимость Значение по умолчанию
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Сертификат подписи, указанный параметром certificate , не проверяется на допустимость входных данных. Чтобы проверить сертификат перед его предоставлением этому конструктору, используйте X509Chain.Build метод.

Применяется к

CmsSigner(SubjectIdentifierType)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Инициализирует новый экземпляр CmsSigner класса с указанным типом идентификатора субъекта.

public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType);
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType)

Параметры

signerIdentifierType
SubjectIdentifierType

Схема, используемая для определения используемого сертификата подписи.

Комментарии

Этот конструктор приводит к следующим значениям свойств по умолчанию:

Недвижимость Значение по умолчанию
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None If SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot иначе

Применяется к

CmsSigner(CspParameters)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Внимание!

CmsSigner(CspParameters) is obsolete and is not supported. Use an alternative constructor instead.

Инициализирует новый экземпляр CmsSigner класса из сохраненного ключа.

public:
 CmsSigner(System::Security::Cryptography::CspParameters ^ parameters);
[System.Obsolete("CmsSigner(CspParameters) is obsolete and is not supported. Use an alternative constructor instead.", DiagnosticId="SYSLIB0034", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public CmsSigner(System.Security.Cryptography.CspParameters parameters);
public CmsSigner(System.Security.Cryptography.CspParameters parameters);
[<System.Obsolete("CmsSigner(CspParameters) is obsolete and is not supported. Use an alternative constructor instead.", DiagnosticId="SYSLIB0034", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.CspParameters -> System.Security.Cryptography.Pkcs.CmsSigner
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.CspParameters -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (parameters As CspParameters)

Параметры

parameters
CspParameters

Параметры CSP, описывающие используемый ключ подписи.

Атрибуты

Исключения

Только .NET Core и .NET 5+ : во всех случаях.

Комментарии

Этот конструктор приводит к следующим значениям свойств по умолчанию:

Недвижимость Значение по умолчанию
SignerIdentifierType SubjectIdentifierType.SubjectKeyIdentifier
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None

Important

Этот метод поддерживается только в .NET Framework. Его использование в .NET Core создает PlatformNotSupportedException.

Применяется к

CmsSigner(SubjectIdentifierType, X509Certificate2)

Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs
Исходный код:
CmsSigner.cs

Инициализирует новый экземпляр CmsSigner класса с указанным сертификатом подписи и типом идентификатора субъекта.

public:
 CmsSigner(System::Security::Cryptography::Pkcs::SubjectIdentifierType signerIdentifierType, System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2? certificate);
public CmsSigner(System.Security.Cryptography.Pkcs.SubjectIdentifierType signerIdentifierType, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
new System.Security.Cryptography.Pkcs.CmsSigner : System.Security.Cryptography.Pkcs.SubjectIdentifierType * System.Security.Cryptography.X509Certificates.X509Certificate2 -> System.Security.Cryptography.Pkcs.CmsSigner
Public Sub New (signerIdentifierType As SubjectIdentifierType, certificate As X509Certificate2)

Параметры

signerIdentifierType
SubjectIdentifierType

Схема, используемая для определения используемого сертификата подписи.

certificate
X509Certificate2

Сертификат, закрытый ключ которого будет использоваться для подписи сообщения.

Комментарии

Этот конструктор приводит к следующим значениям свойств по умолчанию:

Недвижимость Значение по умолчанию
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None If SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot иначе

Сертификат подписи, указанный параметром certificate , не проверяется на допустимость входных данных. Чтобы проверить сертификат перед его предоставлением этому конструктору, используйте X509Chain.Build метод.

Применяется к