CmsSigner Construtores

Definição

Inicializa uma nova instância da classe CmsSigner.Initializes a new instance of the CmsSigner class.

Sobrecargas

CmsSigner()

Inicializa uma nova instância da classe CmsSigner com valores padrão.Initializes a new instance of the CmsSigner class with default values.

CmsSigner(CspParameters)

Inicializa uma nova instância da classe CmsSigner de uma chave persistente.Initializes a new instance of the CmsSigner class from a persisted key.

CmsSigner(SubjectIdentifierType)

Inicializa uma nova instância da classe CmsSigner com um tipo de identificador de entidade.Initializes a new instance of the CmsSigner class with a specified subject identifier type.

CmsSigner(X509Certificate2)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado.Initializes a new instance of the CmsSigner class with a specified signer certificate.

CmsSigner(SubjectIdentifierType, X509Certificate2)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado e o tipo de identificador de entidade.Initializes a new instance of the CmsSigner class with a specified signer certificate and subject identifier type.

CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado, o tipo de identificador de entidade e o objeto de chave privada.Initializes a new instance of the CmsSigner class with a specified signer certificate, subject identifier type, and private key object.

CmsSigner()

Inicializa uma nova instância da classe CmsSigner com valores padrão.Initializes a new instance of the CmsSigner class with default values.

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

Comentários

Esse construtor resulta nos seguintes valores de propriedade padrão:This constructor results in the following default property values:

PropriedadeProperty Valor padrãoDefault value
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Aplica-se a

CmsSigner(CspParameters)

Inicializa uma nova instância da classe CmsSigner de uma chave persistente.Initializes a new instance of the CmsSigner class from a persisted key.

public:
 CmsSigner(System::Security::Cryptography::CspParameters ^ parameters);
public CmsSigner (System.Security.Cryptography.CspParameters parameters);
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 chave de assinatura será usada.The CSP parameters to describe which signing key to use.

Exceções

Somente .NET 5+ e .NET Core: Não há suporte para esse membro..NET 5+ and .NET Core only: This member is not supported.

Comentários

Esse construtor resulta nos seguintes valores de propriedade padrão:This constructor results in the following default property values:

PropriedadeProperty Valor padrãoDefault value
SignerIdentifierType SubjectIdentifierType.SubjectKeyIdentifier
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None

Importante

Este método só tem suporte em .NET Framework.This method is only supported on .NET Framework. Seu uso no .NET Core gera um PlatformNotSupportedException .Its use on .NET Core throws a PlatformNotSupportedException.

Aplica-se a

CmsSigner(SubjectIdentifierType)

Inicializa uma nova instância da classe CmsSigner com um tipo de identificador de entidade.Initializes a new instance of the CmsSigner class with a specified subject identifier type.

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 ser usado para identificar qual certificado de autenticação foi usado.The scheme to use for identifying which signing certificate was used.

Comentários

Esse construtor resulta nos seguintes valores de propriedade padrão:This constructor results in the following default property values:

PropriedadeProperty Valor padrãoDefault value
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None Se SignerIdentifierType for SubjectIdentifierType.NoSignature ,X509IncludeOption.None if SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot ,X509IncludeOption.ExcludeRoot otherwise

Aplica-se a

CmsSigner(X509Certificate2)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado.Initializes a new instance of the CmsSigner class with a specified signer certificate.

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.The certificate whose private key will be used to sign a message.

Comentários

Esse construtor resulta nos seguintes valores de propriedade padrão:This constructor results in the following default property values:

PropriedadeProperty Valor padrãoDefault value
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

O certificado de autenticação especificado pelo certificate parâmetro não é verificado quanto à validade na entrada.The signing certificate specified by the certificate parameter is not checked for validity on input. Para validar o certificado antes de fornecê-lo a esse construtor, use o X509Chain.Build método.To validate the certificate prior to supplying it to this constructor, use the X509Chain.Build method.

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado e o tipo de identificador de entidade.Initializes a new instance of the CmsSigner class with a specified signer certificate and subject identifier type.

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 ser usado para identificar qual certificado de autenticação foi usado.The scheme to use for identifying which signing certificate was used.

certificate
X509Certificate2

O certificado cuja chave privada será usada para assinar uma mensagem.The certificate whose private key will be used to sign a message.

Comentários

Esse construtor resulta nos seguintes valores de propriedade padrão:This constructor results in the following default property values:

PropriedadeProperty Valor padrãoDefault value
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None Se SignerIdentifierType for SubjectIdentifierType.NoSignature ,X509IncludeOption.None if SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot ,X509IncludeOption.ExcludeRoot otherwise

O certificado de autenticação especificado pelo certificate parâmetro não é verificado quanto à validade na entrada.The signing certificate specified by the certificate parameter is not checked for validity on input. Para validar o certificado antes de fornecê-lo a esse construtor, use o X509Chain.Build método.To validate the certificate prior to supplying it to this constructor, use the X509Chain.Build method.

Aplica-se a

CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Inicializa uma nova instância da classe CmsSigner com um certificado de signatário especificado, o tipo de identificador de entidade e o objeto de chave privada.Initializes a new instance of the CmsSigner class with a specified signer certificate, subject identifier type, and private key object.

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 ser usado para identificar qual certificado de autenticação foi usado.One of the enumeration values that specifies the scheme to use for identifying which signing certificate was used.

certificate
X509Certificate2

O certificado cuja chave privada será usada para assinar uma mensagem.The certificate whose private key will be used to sign a message.

privateKey
AsymmetricAlgorithm

O objeto de chave privada a ser usado ao assinar a mensagem.The private key object to use when signing the message.

Comentários

Esse construtor resulta nos seguintes valores de propriedade padrão:This constructor results in the following default property values:

PropriedadeProperty Valor padrãoDefault value
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None Se SignerIdentifierType for SubjectIdentifierType.NoSignature ,X509IncludeOption.None if SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot ,X509IncludeOption.ExcludeRoot otherwise

O certificado de autenticação especificado pelo certificate parâmetro não é verificado quanto à validade na entrada.The signing certificate specified by the certificate parameter is not checked for validity on input. Para validar o certificado antes de fornecê-lo a esse construtor, use o X509Chain.Build método.To validate the certificate prior to supplying it to this constructor, use the X509Chain.Build method.

Esse construtor não valida se o privateKey parâmetro corresponde à chave pública no certificate .This constructor does not validate that the privateKey parameter corresponds to the public key in certificate. Se as chaves não corresponderem, a SignedCms classe e o ComputeCounterSignature(CmsSigner) método lançarão um CryptographicException durante o processo de assinatura.If the keys don't match, the SignedCms class and ComputeCounterSignature(CmsSigner) method throw a CryptographicException during the signing process.

Aplica-se a