X509Certificate.Import Metoda

Definice

Naplní X509Certificate objekt.

Přetížení

Import(String, String, X509KeyStorageFlags)
Zastaralé.
Zastaralé.

Naplní X509Certificate objekt informacemi ze souboru certifikátu, hesla a X509KeyStorageFlags hodnoty.

Import(String, SecureString, X509KeyStorageFlags)
Zastaralé.
Zastaralé.

Naplní X509Certificate objekt informacemi ze souboru certifikátu, hesla a příznaku úložiště klíčů.

Import(Byte[], String, X509KeyStorageFlags)
Zastaralé.
Zastaralé.

Naplní X509Certificate objekt pomocí dat z pole bajtů, hesla a příznaků pro určení způsobu importu privátního klíče.

Import(Byte[])
Zastaralé.
Zastaralé.

Naplní X509Certificate objekt daty z pole bajtů.

Import(String)
Zastaralé.
Zastaralé.

Naplní X509Certificate objekt informacemi ze souboru certifikátu.

Import(Byte[], SecureString, X509KeyStorageFlags)
Zastaralé.
Zastaralé.

Naplní X509Certificate objekt pomocí dat z pole bajtů, hesla a příznaku úložiště klíčů.

Import(String, String, X509KeyStorageFlags)

Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs

Upozornění

X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.

Upozornění

X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.

Naplní X509Certificate objekt informacemi ze souboru certifikátu, hesla a X509KeyStorageFlags hodnoty.

public:
 virtual void Import(System::String ^ fileName, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public virtual void Import (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public virtual void Import (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void Import (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public virtual void Import (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
abstract member Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
abstract member Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
abstract member Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Overridable Sub Import (fileName As String, password As String, keyStorageFlags As X509KeyStorageFlags)

Parametry

fileName
String

Název souboru certifikátu reprezentovaný jako řetězec.

password
String

Heslo potřebné pro přístup k datům certifikátu X.509.

keyStorageFlags
X509KeyStorageFlags

Bitové kombinace hodnot výčtu, které řídí, kam a jak importovat certifikát.

Atributy

Výjimky

Parametr fileName je null.

Pouze .NET Core a .NET 5+: Ve všech případech.

Poznámky

Důležité

Nikdy pevně nezakódujte heslo ve zdrojovém kódu. Pevně zakódovaná hesla lze načíst ze sestavení pomocí Ildasm.exe (IL Disassembler), šestnáctkového editoru nebo jednoduše otevřením sestavení v textovém editoru, jako je Notepad.exe.

Platí pro

Import(String, SecureString, X509KeyStorageFlags)

Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs

Upozornění

X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.

Upozornění

X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.

Důležité

Toto rozhraní API neodpovídá specifikaci CLS.

Naplní X509Certificate objekt informacemi ze souboru certifikátu, hesla a příznaku úložiště klíčů.

public:
 virtual void Import(System::String ^ fileName, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public virtual void Import (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public virtual void Import (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public virtual void Import (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Security.SecurityCritical]
public virtual void Import (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[<System.CLSCompliant(false)>]
abstract member Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.CLSCompliant(false)>]
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.CLSCompliant(false)>]
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
abstract member Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Security.SecurityCritical>]
abstract member Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Overridable Sub Import (fileName As String, password As SecureString, keyStorageFlags As X509KeyStorageFlags)

Parametry

fileName
String

Název souboru certifikátu.

password
SecureString

Heslo potřebné pro přístup k datům certifikátu X.509.

keyStorageFlags
X509KeyStorageFlags

Bitové kombinace hodnot výčtu, které řídí, kam a jak importovat certifikát.

Atributy

Výjimky

Parametr fileName je null.

Pouze .NET Core a .NET 5+: Ve všech případech.

Poznámky

Důležité

Nikdy pevně nezakódujte heslo ve zdrojovém kódu. Pevně zakódovaná hesla lze načíst ze sestavení pomocí Ildasm.exe (IL Disassembler), šestnáctkového editoru nebo jednoduše otevřením sestavení v textovém editoru, jako je Notepad.exe.

Platí pro

Import(Byte[], String, X509KeyStorageFlags)

Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs

Upozornění

X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.

Upozornění

X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.

Naplní X509Certificate objekt pomocí dat z pole bajtů, hesla a příznaků pro určení způsobu importu privátního klíče.

public:
 virtual void Import(cli::array <System::Byte> ^ rawData, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public virtual void Import (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public virtual void Import (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void Import (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public virtual void Import (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
abstract member Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
abstract member Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
abstract member Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Overridable Sub Import (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags)

Parametry

rawData
Byte[]

Pole bajtů obsahující data z certifikátu X.509.

password
String

Heslo potřebné pro přístup k datům certifikátu X.509.

keyStorageFlags
X509KeyStorageFlags

Bitové kombinace hodnot výčtu, které řídí, kam a jak importovat certifikát.

Atributy

Výjimky

Parametr rawData je null.

-nebo-

Délka parametru rawData je 0.

Pouze .NET Core a .NET 5+: Ve všech případech.

Poznámky

Tuto metodu lze použít k naplnění objektu X509Certificate pomocí hesla pro certifikát reprezentovaný polem bajtů. Pomocí X509KeyStorageFlags této hodnoty můžete řídit, kam a jak se bude privátní klíč importovat.

Platí pro

Import(Byte[])

Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs

Upozornění

X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.

Upozornění

X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.

Naplní X509Certificate objekt daty z pole bajtů.

public:
 virtual void Import(cli::array <System::Byte> ^ rawData);
public virtual void Import (byte[] rawData);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (byte[] rawData);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (byte[] rawData);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void Import (byte[] rawData);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public virtual void Import (byte[] rawData);
abstract member Import : byte[] -> unit
override this.Import : byte[] -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : byte[] -> unit
override this.Import : byte[] -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : byte[] -> unit
override this.Import : byte[] -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
abstract member Import : byte[] -> unit
override this.Import : byte[] -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
abstract member Import : byte[] -> unit
override this.Import : byte[] -> unit
Public Overridable Sub Import (rawData As Byte())

Parametry

rawData
Byte[]

Pole bajtů obsahující data z certifikátu X.509.

Atributy

Výjimky

Parametr rawData je null.

-nebo-

Délka parametru rawData je 0.

Pouze .NET Core a .NET 5+: Ve všech případech.

Poznámky

Tuto metodu lze použít k převzetí nezpracovaného pole bajtů certifikátu X.509 a naplnění objektu X509Certificate jeho přidruženými hodnotami.

Platí pro

Import(String)

Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs

Upozornění

X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.

Upozornění

X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.

Naplní X509Certificate objekt informacemi ze souboru certifikátu.

public:
 virtual void Import(System::String ^ fileName);
public virtual void Import (string fileName);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (string fileName);
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (string fileName);
[System.Runtime.InteropServices.ComVisible(false)]
public virtual void Import (string fileName);
[System.Runtime.InteropServices.ComVisible(false)]
[System.Security.SecurityCritical]
public virtual void Import (string fileName);
abstract member Import : string -> unit
override this.Import : string -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : string -> unit
override this.Import : string -> unit
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : string -> unit
override this.Import : string -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
abstract member Import : string -> unit
override this.Import : string -> unit
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Security.SecurityCritical>]
abstract member Import : string -> unit
override this.Import : string -> unit
Public Overridable Sub Import (fileName As String)

Parametry

fileName
String

Název souboru certifikátu reprezentovaný jako řetězec.

Atributy

Výjimky

Parametr fileName je null.

Pouze .NET Core a .NET 5+: Ve všech případech.

Příklady

Následující příklad načte ze souboru certifikát X.509, zavolá metodu ToString a zobrazí výsledky do konzoly.

using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int main()
{
   
   // The path to the certificate.
   String^ Certificate = L"Certificate.cer";
   
   // Load the certificate into an X509Certificate object.
   X509Certificate^ cert = gcnew X509Certificate;
   cert->Import(Certificate);
   
   // Get the value.
   String^ resultsTrue = cert->ToString( true );
   
   // Display the value to the console.
   Console::WriteLine( resultsTrue );
   
   // Get the value.
   String^ resultsFalse = cert->ToString( false );
   
   // Display the value to the console.
   Console::WriteLine( resultsFalse );
}
using System;
using System.Security.Cryptography.X509Certificates;

class X509
{

    static void Main()
    {

        // The path to the certificate.
        string Certificate = "Certificate.cer";

        // Load the certificate into an X509Certificate object.
        X509Certificate cert = new X509Certificate();

        cert.Import(Certificate);

        // Get the value.
        string resultsTrue = cert.ToString(true);

        // Display the value to the console.
        Console.WriteLine(resultsTrue);

        // Get the value.
        string resultsFalse = cert.ToString(false);

        // Display the value to the console.
        Console.WriteLine(resultsFalse);
    }
}
Imports System.Security.Cryptography.X509Certificates

Module X509

    Sub Main()

        ' The path to the certificate.
        Dim Certificate As String = "Certificate.cer"

        ' Load the certificate into an X509Certificate object.
        Dim cert As New X509Certificate

        cert.Import(Certificate)

        ' Get the value.
        Dim resultsTrue As String = cert.ToString(True)

        ' Display the value to the console.
        Console.WriteLine(resultsTrue)

        ' Get the value.
        Dim resultsFalse As String = cert.ToString(False)

        ' Display the value to the console.
        Console.WriteLine(resultsFalse)

    End Sub
End Module

Poznámky

Tato metoda používá soubor certifikátu (například soubor s příponou .cer), který představuje certifikát X.509 a naplní X509Certificate objekt certifikátem, který soubor obsahuje.

Platí pro

Import(Byte[], SecureString, X509KeyStorageFlags)

Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs
Zdroj:
X509Certificate.cs

Upozornění

X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.

Upozornění

X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.

Důležité

Toto rozhraní API neodpovídá specifikaci CLS.

Naplní X509Certificate objekt pomocí dat z pole bajtů, hesla a příznaku úložiště klíčů.

public:
 virtual void Import(cli::array <System::Byte> ^ rawData, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public virtual void Import (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public virtual void Import (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public virtual void Import (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public virtual void Import (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Security.SecurityCritical]
public virtual void Import (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[<System.CLSCompliant(false)>]
abstract member Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.CLSCompliant(false)>]
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.CLSCompliant(false)>]
[<System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
abstract member Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
abstract member Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
[<System.Security.SecurityCritical>]
abstract member Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
override this.Import : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Overridable Sub Import (rawData As Byte(), password As SecureString, keyStorageFlags As X509KeyStorageFlags)

Parametry

rawData
Byte[]

Pole bajtů, které obsahuje data z certifikátu X.509.

password
SecureString

Heslo potřebné pro přístup k datům certifikátu X.509.

keyStorageFlags
X509KeyStorageFlags

Bitové kombinace hodnot výčtu, které řídí, kam a jak importovat certifikát.

Atributy

Výjimky

Parametr rawData je null.

-nebo-

Délka parametru rawData je 0.

Pouze .NET Core a .NET 5+: Ve všech případech.

Poznámky

Důležité

Nikdy pevně nezakódujte heslo ve zdrojovém kódu. Pevně zakódovaná hesla lze načíst ze sestavení pomocí Ildasm.exe (IL Disassembler), šestnáctkového editoru nebo jednoduše otevřením sestavení v textovém editoru, jako je Notepad.exe.

Platí pro