CmsSigner Konstruktorer

Definition

Initierar en ny instans av CmsSigner klassen.

Överlagringar

Name Description
CmsSigner()

Initierar en ny instans av CmsSigner klassen med standardvärden.

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

Initierar en ny instans av CmsSigner klassen med ett angivet signeringscertifikat, ämnesidentifierartyp och privat nyckelobjekt.

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Initierar en ny instans av klassen CmsSigner med ett angivet signeringscertifikat, ämnesidentifierartyp, privat nyckelobjekt och utfyllnad av RSA-signatur.

CmsSigner(X509Certificate2)

Initierar en ny instans av CmsSigner klassen med ett angivet undertecknarcertifikat.

CmsSigner(SubjectIdentifierType)

Initierar en ny instans av CmsSigner klassen med en angiven ämnesidentifierartyp.

CmsSigner(CspParameters)
Föråldrad.

Initierar en ny instans av CmsSigner klassen från en bevarad nyckel.

CmsSigner(SubjectIdentifierType, X509Certificate2)

Initierar en ny instans av CmsSigner klassen med ett angivet signeringscertifikat och ämnesidentifierartyp.

CmsSigner()

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Initierar en ny instans av CmsSigner klassen med standardvärden.

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

Kommentarer

Den här konstruktorn resulterar i följande standardegenskapsvärden:

Fastighet Standardvärdet
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Gäller för

CmsSigner(SubjectIdentifierType, X509Certificate2, SlhDsa)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
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)

Parametrar

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
SlhDsa
Attribut

Gäller för

CmsSigner(SubjectIdentifierType, X509Certificate2, MLDsa)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
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)

Parametrar

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
MLDsa
Attribut

Gäller för

CmsSigner(SubjectIdentifierType, X509Certificate2, CompositeMLDsa)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
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)

Parametrar

signerIdentifierType
SubjectIdentifierType
certificate
X509Certificate2
privateKey
CompositeMLDsa
Attribut

Gäller för

CmsSigner(SubjectIdentifierType, X509Certificate2, AsymmetricAlgorithm)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Initierar en ny instans av CmsSigner klassen med ett angivet signeringscertifikat, ämnesidentifierartyp och privat nyckelobjekt.

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)

Parametrar

signerIdentifierType
SubjectIdentifierType

Ett av uppräkningsvärdena som anger vilket schema som ska användas för att identifiera vilket signeringscertifikat som användes.

certificate
X509Certificate2

Certifikatet vars privata nyckel ska användas för att signera ett meddelande.

privateKey
AsymmetricAlgorithm

Det privata nyckelobjekt som ska användas när meddelandet signeras.

Kommentarer

Den här konstruktorn resulterar i följande standardegenskapsvärden:

Fastighet Standardvärdet
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None if SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot annars

Signeringscertifikatet som anges av parametern certificate kontrolleras inte för giltighet vid indata. Använd metoden för att verifiera certifikatet innan det skickas till konstruktorn X509Chain.Build .

Konstruktorn verifierar inte att parametern privateKey motsvarar den offentliga nyckeln i certificate. Om nycklarna inte matchar SignedCms genererar klassen och ComputeCounterSignature(CmsSigner) metoden en CryptographicException under signeringsprocessen.

Gäller för

CmsSigner(SubjectIdentifierType, X509Certificate2, RSA, RSASignaturePadding)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Initierar en ny instans av klassen CmsSigner med ett angivet signeringscertifikat, ämnesidentifierartyp, privat nyckelobjekt och utfyllnad av RSA-signatur.

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)

Parametrar

signerIdentifierType
SubjectIdentifierType

Ett av uppräkningsvärdena som anger vilket schema som ska användas för att identifiera vilket signeringscertifikat som användes.

certificate
X509Certificate2

Certifikatet vars privata nyckel ska användas för att signera ett meddelande.

privateKey
RSA

Det privata nyckelobjekt som ska användas när meddelandet signeras.

signaturePadding
RSASignaturePadding

Utfyllnad av RSA-signatur som ska användas.

Gäller för

CmsSigner(X509Certificate2)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Initierar en ny instans av CmsSigner klassen med ett angivet undertecknarcertifikat.

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)

Parametrar

certificate
X509Certificate2

Certifikatet vars privata nyckel ska användas för att signera ett meddelande.

Kommentarer

Den här konstruktorn resulterar i följande standardegenskapsvärden:

Fastighet Standardvärdet
SignerIdentifierType SubjectIdentifierType.IssuerAndSerialNumber
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.ExcludeRoot

Signeringscertifikatet som anges av parametern certificate kontrolleras inte för giltighet vid indata. Använd metoden för att verifiera certifikatet innan det skickas till konstruktorn X509Chain.Build .

Gäller för

CmsSigner(SubjectIdentifierType)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Initierar en ny instans av CmsSigner klassen med en angiven ämnesidentifierartyp.

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)

Parametrar

signerIdentifierType
SubjectIdentifierType

Det schema som ska användas för att identifiera vilket signeringscertifikat som användes.

Kommentarer

Den här konstruktorn resulterar i följande standardegenskapsvärden:

Fastighet Standardvärdet
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None if SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot annars

Gäller för

CmsSigner(CspParameters)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Varning

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

Initierar en ny instans av CmsSigner klassen från en bevarad nyckel.

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)

Parametrar

parameters
CspParameters

CSP-parametrarna för att beskriva vilken signeringsnyckel som ska användas.

Attribut

Undantag

.NET Core och .NET endast 5+ : I samtliga fall.

Kommentarer

Den här konstruktorn resulterar i följande standardegenskapsvärden:

Fastighet Standardvärdet
SignerIdentifierType SubjectIdentifierType.SubjectKeyIdentifier
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None

Important

Den här metoden stöds endast i .NET Framework. Dess användning på .NET Core genererar en PlatformNotSupportedException.

Gäller för

CmsSigner(SubjectIdentifierType, X509Certificate2)

Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs
Källa:
CmsSigner.cs

Initierar en ny instans av CmsSigner klassen med ett angivet signeringscertifikat och ämnesidentifierartyp.

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)

Parametrar

signerIdentifierType
SubjectIdentifierType

Det schema som ska användas för att identifiera vilket signeringscertifikat som användes.

certificate
X509Certificate2

Certifikatet vars privata nyckel ska användas för att signera ett meddelande.

Kommentarer

Den här konstruktorn resulterar i följande standardegenskapsvärden:

Fastighet Standardvärdet
DigestAlgorithm 2.16.840.1.101.3.4.2.1 (SHA-256)
IncludeOption X509IncludeOption.None if SignerIdentifierType is SubjectIdentifierType.NoSignature,

X509IncludeOption.ExcludeRoot annars

Signeringscertifikatet som anges av parametern certificate kontrolleras inte för giltighet vid indata. Använd metoden för att verifiera certifikatet innan det skickas till konstruktorn X509Chain.Build .

Gäller för