CmsSigner Costruttori

Definizione

Inizializza una nuova istanza della classe CmsSigner.

Overload

Nome Descrizione
CmsSigner()

Inizializza una nuova istanza della CmsSigner classe con valori predefiniti.

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

Inizializza una nuova istanza della CmsSigner classe con un certificato del firmatario, un tipo di identificatore del soggetto e un oggetto chiave privata specificati.

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Inizializza una nuova istanza della classe CmsSigner con un certificato del firmatario, un tipo di identificatore soggetto, un oggetto chiave privata e una spaziatura interna della firma RSA specificati.

CmsSigner(X509Certificate2)

Inizializza una nuova istanza della CmsSigner classe con un certificato del firmatario specificato.

CmsSigner(SubjectIdentifierType)

Inizializza una nuova istanza della CmsSigner classe con un tipo di identificatore del soggetto specificato.

CmsSigner(CspParameters)
Obsoleti.

Inizializza una nuova istanza della CmsSigner classe da una chiave persistente.

CmsSigner(SubjectIdentifierType, X509Certificate2)

Inizializza una nuova istanza della CmsSigner classe con un certificato del firmatario e un tipo di identificatore del soggetto specificati.

CmsSigner()

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Inizializza una nuova istanza della CmsSigner classe con valori predefiniti.

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

Commenti

Questo costruttore restituisce i valori di proprietà predefiniti seguenti:

Proprietà Valore predefinito
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Si applica a

CmsSigner(SubjectIdentifierType, X509Certificate2, SlhDsa)

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

Parametri

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
SlhDsa
Attributi

Si applica a

CmsSigner(SubjectIdentifierType, X509Certificate2, MLDsa)

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

Parametri

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
MLDsa
Attributi

Si applica a

CmsSigner(SubjectIdentifierType, X509Certificate2, CompositeMLDsa)

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

Parametri

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
CompositeMLDsa
Attributi

Si applica a

CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Inizializza una nuova istanza della CmsSigner classe con un certificato del firmatario, un tipo di identificatore del soggetto e un oggetto chiave privata specificati.

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)

Parametri

signerIdentifierType
SubjectIdentifierType

Uno dei valori di enumerazione che specifica lo schema da usare per identificare il certificato di firma utilizzato.

certificate
X509Certificate2

Certificato la cui chiave privata verrà usata per firmare un messaggio.

privateKey
AsymmetricAlgorithm

Oggetto chiave privata da utilizzare durante la firma del messaggio.

Commenti

Questo costruttore restituisce i valori di proprietà predefiniti seguenti:

Proprietà Valore predefinito
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None se SignerIdentifierType è SubjectIdentifierType.NoSignature,

In caso contrario, X509IncludeOption.ExcludeRoot

Il certificato di firma specificato dal certificate parametro non viene controllato per la validità dell'input. Per convalidare il certificato prima di fornirlo a questo costruttore, usare il X509Chain.Build metodo .

Questo costruttore non convalida che il privateKey parametro corrisponda alla chiave pubblica in certificate. Se le chiavi non corrispondono, la classe e ComputeCounterSignature(CmsSigner) il SignedCms metodo generano un'eccezione CryptographicException durante il processo di firma.

Si applica a

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Inizializza una nuova istanza della classe CmsSigner con un certificato del firmatario, un tipo di identificatore soggetto, un oggetto chiave privata e una spaziatura interna della firma RSA specificati.

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)

Parametri

signerIdentifierType
SubjectIdentifierType

Uno dei valori di enumerazione che specifica lo schema da usare per identificare il certificato di firma utilizzato.

certificate
X509Certificate2

Certificato la cui chiave privata verrà usata per firmare un messaggio.

privateKey
RSA

Oggetto chiave privata da utilizzare durante la firma del messaggio.

signaturePadding
RSASignaturePadding

Spaziatura interna della firma RSA da usare.

Si applica a

CmsSigner(X509Certificate2)

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Inizializza una nuova istanza della CmsSigner classe con un certificato del firmatario specificato.

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)

Parametri

certificate
X509Certificate2

Certificato la cui chiave privata verrà usata per firmare un messaggio.

Commenti

Questo costruttore restituisce i valori di proprietà predefiniti seguenti:

Proprietà Valore predefinito
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Il certificato di firma specificato dal certificate parametro non viene controllato per la validità dell'input. Per convalidare il certificato prima di fornirlo a questo costruttore, usare il X509Chain.Build metodo .

Si applica a

CmsSigner(SubjectIdentifierType)

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Inizializza una nuova istanza della CmsSigner classe con un tipo di identificatore del soggetto specificato.

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)

Parametri

signerIdentifierType
SubjectIdentifierType

Schema da usare per identificare il certificato di firma usato.

Commenti

Questo costruttore restituisce i valori di proprietà predefiniti seguenti:

Proprietà Valore predefinito
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None se SignerIdentifierType è SubjectIdentifierType.NoSignature,

In caso contrario, X509IncludeOption.ExcludeRoot

Si applica a

CmsSigner(CspParameters)

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Attenzione

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

Inizializza una nuova istanza della CmsSigner classe da una chiave 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)

Parametri

parameters
CspParameters

Parametri CSP per descrivere la chiave di firma da usare.

Attributi

Eccezioni

Solo .NET Core e .NET 5+: in tutti i casi.

Commenti

Questo costruttore restituisce i valori di proprietà predefiniti seguenti:

Proprietà Valore predefinito
SignerIdentifierType SubjectIdentifierType.SubjectKeyIdentifier
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None

Importante

Questo metodo è supportato solo in .NET Framework. L'uso in .NET Core genera un PlatformNotSupportedException.

Si applica a

CmsSigner(SubjectIdentifierType, X509Certificate2)

Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs
Origine:
CmsSigner.cs

Inizializza una nuova istanza della CmsSigner classe con un certificato del firmatario e un tipo di identificatore del soggetto specificati.

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)

Parametri

signerIdentifierType
SubjectIdentifierType

Schema da usare per identificare il certificato di firma usato.

certificate
X509Certificate2

Certificato la cui chiave privata verrà usata per firmare un messaggio.

Commenti

Questo costruttore restituisce i valori di proprietà predefiniti seguenti:

Proprietà Valore predefinito
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None se SignerIdentifierType è SubjectIdentifierType.NoSignature,

In caso contrario, X509IncludeOption.ExcludeRoot

Il certificato di firma specificato dal certificate parametro non viene controllato per la validità dell'input. Per convalidare il certificato prima di fornirlo a questo costruttore, usare il X509Chain.Build metodo .

Si applica a