Condividi tramite


X509Certificate2Collection.Import Metodo

Definizione

Importa un certificato in un oggetto X509Certificate2Collection.

Overload

Import(String, String, X509KeyStorageFlags)
Obsoleti.

Importa un file di certificato che richiede una password in un oggetto X509Certificate2Collection.

Import(String, ReadOnlySpan<Char>, X509KeyStorageFlags)
Obsoleti.

Importa i certificati dal file specificato in questa raccolta.

Import(ReadOnlySpan<Byte>, String, X509KeyStorageFlags)
Obsoleti.

Importa i certificati dai dati forniti in questa raccolta.

Import(ReadOnlySpan<Byte>, ReadOnlySpan<Char>, X509KeyStorageFlags)
Obsoleti.

Importa i certificati dai dati forniti in questa raccolta.

Import(ReadOnlySpan<Byte>)
Obsoleti.

Importa i certificati dai dati forniti in questa raccolta.

Import(String)
Obsoleti.

Importa un file di certificato in un oggetto X509Certificate2Collection.

Import(Byte[])
Obsoleti.

Importa un certificato sotto forma di matrice di byte in un oggetto X509Certificate2Collection.

Import(Byte[], String, X509KeyStorageFlags)
Obsoleti.

Importa un certificato, sotto forma di matrice di byte che richiede una password per accedere al certificato, in un oggetto X509Certificate2Collection.

Import(String, String, X509KeyStorageFlags)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa un file di certificato che richiede una password in un oggetto X509Certificate2Collection.

public:
 void Import(System::String ^ fileName, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public void Import (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
public void Import (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
member this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (fileName As String, password As String, Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet)
Public Sub Import (fileName As String, password As String, keyStorageFlags As X509KeyStorageFlags)

Parametri

fileName
String

Nome del file contenente le informazioni sul certificato.

password
String

Password necessaria per accedere alle informazioni sul certificato.

keyStorageFlags
X509KeyStorageFlags

Combinazione bit per bit dei valori di enumerazione che controllano come e dove viene importato il certificato.

Attributi

Commenti

Questo metodo può essere usato con un file PFX/PKCS12 o altri file di certificato che richiedono una password. I contenitori di chiavi associati ai certificati nel file PFX/PKCS12 possono essere creati e X509KeyStorageFlags valore può essere usato per controllare questo processo. Si noti che se non si crea un contenitore di chiavi, la chiave privata non viene salvata in modo permanente.

Si noti che un file PFX/PKCS12 può contenere più di un certificato. Questo metodo importa il primo certificato associato alla chiave privata o, se non viene trovata alcuna chiave privata, il primo certificato trovato.

Questo metodo supporta i tipi di X509ContentType seguenti:

Si applica a

Import(String, ReadOnlySpan<Char>, X509KeyStorageFlags)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa i certificati dal file specificato in questa raccolta.

public void Import (string fileName, ReadOnlySpan<char> password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (string fileName, ReadOnlySpan<char> password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
member this.Import : string * ReadOnlySpan<char> * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : string * ReadOnlySpan<char> * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (fileName As String, password As ReadOnlySpan(Of Char), Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet)

Parametri

fileName
String

Nome del file contenente le informazioni sul certificato.

password
ReadOnlySpan<Char>

Password necessaria per accedere ai dati del certificato.

keyStorageFlags
X509KeyStorageFlags

Combinazione bit per bit dei valori di enumerazione che controllano dove e come importare il certificato.

Attributi

Si applica a

Import(ReadOnlySpan<Byte>, String, X509KeyStorageFlags)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa i certificati dai dati forniti in questa raccolta.

public void Import (ReadOnlySpan<byte> rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (ReadOnlySpan<byte> rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
member this.Import : ReadOnlySpan<byte> * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : ReadOnlySpan<byte> * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (rawData As ReadOnlySpan(Of Byte), password As String, Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet)

Parametri

rawData
ReadOnlySpan<Byte>

Dati del certificato da leggere.

password
String

Password necessaria per accedere ai dati del certificato.

keyStorageFlags
X509KeyStorageFlags

Combinazione bit per bit dei valori di enumerazione che controllano dove e come importare il certificato.

Attributi

Si applica a

Import(ReadOnlySpan<Byte>, ReadOnlySpan<Char>, X509KeyStorageFlags)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa i certificati dai dati forniti in questa raccolta.

public void Import (ReadOnlySpan<byte> rawData, ReadOnlySpan<char> password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (ReadOnlySpan<byte> rawData, ReadOnlySpan<char> password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
member this.Import : ReadOnlySpan<byte> * ReadOnlySpan<char> * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : ReadOnlySpan<byte> * ReadOnlySpan<char> * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (rawData As ReadOnlySpan(Of Byte), password As ReadOnlySpan(Of Char), Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet)

Parametri

rawData
ReadOnlySpan<Byte>

Dati del certificato da leggere.

password
ReadOnlySpan<Char>

Password necessaria per accedere ai dati del certificato.

keyStorageFlags
X509KeyStorageFlags

Combinazione bit per bit dei valori di enumerazione che controllano dove e come importare il certificato.

Attributi

Si applica a

Import(ReadOnlySpan<Byte>)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa i certificati dai dati forniti in questa raccolta.

public:
 void Import(ReadOnlySpan<System::Byte> rawData);
public void Import (ReadOnlySpan<byte> rawData);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (ReadOnlySpan<byte> rawData);
member this.Import : ReadOnlySpan<byte> -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : ReadOnlySpan<byte> -> unit
Public Sub Import (rawData As ReadOnlySpan(Of Byte))

Parametri

rawData
ReadOnlySpan<Byte>

Dati del certificato da leggere.

Attributi

Si applica a

Import(String)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa un file di certificato in un oggetto X509Certificate2Collection.

public:
 void Import(System::String ^ fileName);
public void Import (string fileName);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (string fileName);
member this.Import : string -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : string -> unit
Public Sub Import (fileName As String)

Parametri

fileName
String

Nome del file contenente le informazioni sul certificato.

Attributi

Commenti

Questo metodo supporta i tipi di X509ContentType seguenti:

Si applica a

Import(Byte[])

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa un certificato sotto forma di matrice di byte in un oggetto X509Certificate2Collection.

public:
 void Import(cli::array <System::Byte> ^ rawData);
public void Import (byte[] rawData);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (byte[] rawData);
member this.Import : byte[] -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : byte[] -> unit
Public Sub Import (rawData As Byte())

Parametri

rawData
Byte[]

Matrice di byte contenente dati da un certificato X.509.

Attributi

Commenti

Questo metodo importa un certificato sotto forma di matrice di byte in un oggetto X509Certificate2Collection. Questo metodo supporta i tipi di X509ContentType seguenti:

Si applica a

Import(Byte[], String, X509KeyStorageFlags)

Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs
Origine:
X509Certificate2Collection.cs

Attenzione

Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.

Importa un certificato, sotto forma di matrice di byte che richiede una password per accedere al certificato, in un oggetto X509Certificate2Collection.

public:
 void Import(cli::array <System::Byte> ^ rawData, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public void Import (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
[System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public void Import (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet);
public void Import (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
member this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("Loading certificate data through the constructor or Import is obsolete. Use X509CertificateLoader instead to load certificates.", DiagnosticId="SYSLIB0057", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Sub Import (rawData As Byte(), password As String, Optional keyStorageFlags As X509KeyStorageFlags = System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.DefaultKeySet)
Public Sub Import (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags)

Parametri

rawData
Byte[]

Matrice di byte contenente dati da un oggetto X509Certificate2.

password
String

Password necessaria per accedere alle informazioni sul certificato.

keyStorageFlags
X509KeyStorageFlags

Combinazione bit per bit dei valori di enumerazione che controllano come e dove viene importato il certificato.

Attributi

Commenti

Questo metodo può essere usato con un oggetto BLOB (Binary Large Object) PFX/PKCS12 protetto da una password. I contenitori di chiavi associati ai certificati nel BLOB PFX/PKCS12 possono essere creati e il valore X509KeyStorageFlags può essere usato per controllare questo processo. Si noti che se non si crea un contenitore di chiavi, la chiave privata non viene salvata in modo permanente.

Questo metodo importa una matrice di byte del certificato in una raccolta di certificati. Questo metodo supporta i tipi di X509ContentType seguenti:

Si applica a