Compartir a través de


X509Certificate2Collection.Import Método

Definición

Importa un certificado en un objeto X509Certificate2Collection.

Sobrecargas

Import(String, String, X509KeyStorageFlags)
Obsoletos.

Importa un archivo de certificado que requiere una contraseña en un objeto X509Certificate2Collection.

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

Importa los certificados del archivo especificado a en esta colección.

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

Importa los certificados de los datos proporcionados en esta colección.

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

Importa los certificados de los datos proporcionados en esta colección.

Import(ReadOnlySpan<Byte>)
Obsoletos.

Importa los certificados de los datos proporcionados en esta colección.

Import(String)
Obsoletos.

Importa un archivo de certificado en un objeto X509Certificate2Collection.

Import(Byte[])
Obsoletos.

Importa un certificado en forma de matriz de bytes en un objeto X509Certificate2Collection.

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

Importa un certificado, en forma de una matriz de bytes que requiere una contraseña para acceder al certificado, en un objeto X509Certificate2Collection.

Import(String, String, X509KeyStorageFlags)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa un archivo de certificado que requiere una contraseña en un objeto 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)

Parámetros

fileName
String

Nombre del archivo que contiene la información del certificado.

password
String

Contraseña necesaria para acceder a la información del certificado.

keyStorageFlags
X509KeyStorageFlags

Combinación bit a bit de los valores de enumeración que controlan cómo y dónde se importa el certificado.

Atributos

Comentarios

Este método se puede usar con un archivo PFX/PKCS12 u otros archivos de certificado que requieran una contraseña. Se pueden crear contenedores de claves asociados a certificados en el archivo PFX/PKCS12 y se puede usar X509KeyStorageFlags valor para controlar este proceso. Tenga en cuenta que si no crea un contenedor de claves, la clave privada no se conserva.

Tenga en cuenta que un archivo PFX/PKCS12 puede contener más de un certificado. Este método importa el primer certificado asociado a la clave privada o, si no se encuentra ninguna clave privada, se encontró el primer certificado.

Este método admite los siguientes tipos de X509ContentType:

Se aplica a

Import(String, ReadOnlySpan<Char>, X509KeyStorageFlags)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa los certificados del archivo especificado a en esta colección.

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)

Parámetros

fileName
String

Nombre del archivo que contiene la información del certificado.

password
ReadOnlySpan<Char>

Contraseña necesaria para acceder a los datos del certificado.

keyStorageFlags
X509KeyStorageFlags

Combinación bit a bit de los valores de enumeración que controlan dónde y cómo importar el certificado.

Atributos

Se aplica a

Import(ReadOnlySpan<Byte>, String, X509KeyStorageFlags)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa los certificados de los datos proporcionados en esta colección.

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)

Parámetros

rawData
ReadOnlySpan<Byte>

Datos del certificado que se van a leer.

password
String

Contraseña necesaria para acceder a los datos del certificado.

keyStorageFlags
X509KeyStorageFlags

Combinación bit a bit de los valores de enumeración que controlan dónde y cómo importar el certificado.

Atributos

Se aplica a

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

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa los certificados de los datos proporcionados en esta colección.

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)

Parámetros

rawData
ReadOnlySpan<Byte>

Datos del certificado que se van a leer.

password
ReadOnlySpan<Char>

Contraseña necesaria para acceder a los datos del certificado.

keyStorageFlags
X509KeyStorageFlags

Combinación bit a bit de los valores de enumeración que controlan dónde y cómo importar el certificado.

Atributos

Se aplica a

Import(ReadOnlySpan<Byte>)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa los certificados de los datos proporcionados en esta colección.

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))

Parámetros

rawData
ReadOnlySpan<Byte>

Datos del certificado que se van a leer.

Atributos

Se aplica a

Import(String)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa un archivo de certificado en un objeto 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)

Parámetros

fileName
String

Nombre del archivo que contiene la información del certificado.

Atributos

Comentarios

Este método admite los siguientes tipos de X509ContentType:

Se aplica a

Import(Byte[])

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa un certificado en forma de matriz de bytes en un objeto 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())

Parámetros

rawData
Byte[]

Matriz de bytes que contiene datos de un certificado X.509.

Atributos

Comentarios

Este método importa un certificado en forma de matriz de bytes en un objeto X509Certificate2Collection. Este método admite los siguientes tipos de X509ContentType:

Se aplica a

Import(Byte[], String, X509KeyStorageFlags)

Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs
Source:
X509Certificate2Collection.cs

Precaución

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

Importa un certificado, en forma de una matriz de bytes que requiere una contraseña para acceder al certificado, en un objeto 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)

Parámetros

rawData
Byte[]

Matriz de bytes que contiene datos de un objeto X509Certificate2.

password
String

Contraseña necesaria para acceder a la información del certificado.

keyStorageFlags
X509KeyStorageFlags

Combinación bit a bit de los valores de enumeración que controlan cómo y dónde se importa el certificado.

Atributos

Comentarios

Este método se puede usar con un objeto binario PFX/PKCS12 (BLOB) protegido por una contraseña. Se pueden crear contenedores de claves asociados a certificados en el BLOB PFX/PKCS12 y se puede usar el valor de X509KeyStorageFlags para controlar este proceso. Tenga en cuenta que si no crea un contenedor de claves, la clave privada no se conserva.

Este método importa una matriz de bytes de certificado en una colección de certificados. Este método admite los siguientes tipos de X509ContentType:

Se aplica a