CmsSigner Construtores

Definição

Inicializa uma nova instância da CmsSigner classe.

Sobrecargas

Name Description
CmsSigner()

Inicializa uma nova instância da CmsSigner classe com valores por defeito.

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

Inicializa uma nova instância da CmsSigner classe com um certificado de assinatura especificado, tipo de identificador de sujeito e objeto chave privada.

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado, tipo de identificador de assunto, objeto de chave privada e enchimento de assinatura RSA.

CmsSigner(X509Certificate2)

Inicializa uma nova instância da CmsSigner classe com um certificado de assinatura especificado.

CmsSigner(SubjectIdentifierType)

Inicializa uma nova instância da CmsSigner classe com um tipo especificado de identificador de sujeito.

CmsSigner(CspParameters)
Obsoleto.

Inicializa uma nova instância da CmsSigner classe a partir de uma chave persistente.

CmsSigner(SubjectIdentifierType, X509Certificate2)

Inicializa uma nova instância da CmsSigner classe com um certificado de assinatura especificado e um tipo de identificador de assunto.

CmsSigner()

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Inicializa uma nova instância da CmsSigner classe com valores por defeito.

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

Observações

Este construtor resulta nos seguintes valores de propriedades por defeito:

Property Valor predefinido
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2, SlhDsa)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
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)

Parâmetros

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
SlhDsa
Atributos

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2, MLDsa)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
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)

Parâmetros

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
MLDsa
Atributos

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2, CompositeMLDsa)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
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)

Parâmetros

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
CompositeMLDsa
Atributos

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Inicializa uma nova instância da CmsSigner classe com um certificado de assinatura especificado, tipo de identificador de sujeito e objeto chave privada.

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)

Parâmetros

signerIdentifierType
SubjectIdentifierType

Um dos valores de enumeração que especifica o esquema a usar para identificar qual o certificado de assinatura utilizado.

certificate
X509Certificate2

O certificado cuja chave privada será usada para assinar uma mensagem.

privateKey
AsymmetricAlgorithm

O objeto de chave privada a usar ao assinar a mensagem.

Observações

Este construtor resulta nos seguintes valores de propriedades por defeito:

Property Valor predefinido
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None se SignerIdentifierType for SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot contrário

O certificado de assinatura especificado pelo certificate parâmetro não é verificado quanto à validade na entrada. Para validar o certificado antes de o fornecer a este construtor, use o X509Chain.Build método.

Este construtor não valida que o privateKey parâmetro corresponda à chave pública em certificate. Se as chaves não coincidirem, a SignedCms classe e ComputeCounterSignature(CmsSigner) o método lançam um CryptographicException durante o processo de assinatura.

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado, tipo de identificador de assunto, objeto de chave privada e enchimento de assinatura 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)

Parâmetros

signerIdentifierType
SubjectIdentifierType

Um dos valores de enumeração que especifica o esquema a usar para identificar qual o certificado de assinatura utilizado.

certificate
X509Certificate2

O certificado cuja chave privada será usada para assinar uma mensagem.

privateKey
RSA

O objeto de chave privada a usar ao assinar a mensagem.

signaturePadding
RSASignaturePadding

O acolchoamento de assinatura RSA para usar.

Aplica-se a

CmsSigner(X509Certificate2)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Inicializa uma nova instância da CmsSigner classe com um certificado de assinatura especificado.

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)

Parâmetros

certificate
X509Certificate2

O certificado cuja chave privada será usada para assinar uma mensagem.

Observações

Este construtor resulta nos seguintes valores de propriedades por defeito:

Property Valor predefinido
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

O certificado de assinatura especificado pelo certificate parâmetro não é verificado quanto à validade na entrada. Para validar o certificado antes de o fornecer a este construtor, use o X509Chain.Build método.

Aplica-se a

CmsSigner(SubjectIdentifierType)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Inicializa uma nova instância da CmsSigner classe com um tipo especificado de identificador de sujeito.

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)

Parâmetros

signerIdentifierType
SubjectIdentifierType

O esquema a utilizar para identificar qual o certificado de assinatura utilizado.

Observações

Este construtor resulta nos seguintes valores de propriedades por defeito:

Property Valor predefinido
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None se SignerIdentifierType for SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot contrário

Aplica-se a

CmsSigner(CspParameters)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Atenção

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

Inicializa uma nova instância da CmsSigner classe a partir de uma chave persistente.

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)

Parâmetros

parameters
CspParameters

Os parâmetros do CSP para descrever qual a chave de assinatura a usar.

Atributos

Exceções

.NET Core e .NET 5+ apenas: Em todos os casos.

Observações

Este construtor resulta nos seguintes valores de propriedades por defeito:

Property Valor predefinido
SignerIdentifierType SubjectIdentifierType.SubjectKeyIdentifier
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None

Importante

Este método só é suportado no .NET Framework. A sua utilização em .NET Core lança um PlatformNotSupportedException.

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2)

Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs
Origem:
CmsSigner.cs

Inicializa uma nova instância da CmsSigner classe com um certificado de assinatura especificado e um tipo de identificador de assunto.

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)

Parâmetros

signerIdentifierType
SubjectIdentifierType

O esquema a utilizar para identificar qual o certificado de assinatura utilizado.

certificate
X509Certificate2

O certificado cuja chave privada será usada para assinar uma mensagem.

Observações

Este construtor resulta nos seguintes valores de propriedades por defeito:

Property Valor predefinido
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None se SignerIdentifierType for SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot contrário

O certificado de assinatura especificado pelo certificate parâmetro não é verificado quanto à validade na entrada. Para validar o certificado antes de o fornecer a este construtor, use o X509Chain.Build método.

Aplica-se a