X509Certificate2.Import 메서드

정의

X509Certificate2 개체를 제공된 인증서 정보로 채웁니다.

오버로드

Import(Byte[])
사용되지 않습니다.

X509Certificate2 개체를 바이트 배열의 데이터로 채웁니다.

Import(String)
사용되지 않습니다.

X509Certificate2 개체를 인증서 파일의 정보로 채웁니다.

Import(Byte[], SecureString, X509KeyStorageFlags)
사용되지 않습니다.

바이트 배열 데이터, 암호 및 키 스토리지 플래그를 사용하여 X509Certificate2 개체를 채웁니다.

Import(Byte[], String, X509KeyStorageFlags)
사용되지 않습니다.

바이트 배열의 데이터, 암호 및 프라이빗 키를 가져오는 방법을 결정하기 위한 플래그를 사용하여 X509Certificate2 개체를 채웁니다.

Import(String, SecureString, X509KeyStorageFlags)
사용되지 않습니다.

인증서 파일의 정보, 암호 및 키 스토리지 플래그로 X509Certificate2 개체를 채웁니다.

Import(String, String, X509KeyStorageFlags)
사용되지 않습니다.

X509Certificate2 개체를 인증서 파일의 정보, 암호 및 X509KeyStorageFlags 값으로 채웁니다.

Import(Byte[])

주의

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

X509Certificate2 개체를 바이트 배열의 데이터로 채웁니다.

public:
 override void Import(cli::array <System::Byte> ^ rawData);
public override 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 override void Import (byte[] rawData);
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}")>]
override this.Import : byte[] -> unit
Public Overrides Sub Import (rawData As Byte())

매개 변수

rawData
Byte[]

X.509 인증서의 데이터가 들어 있는 바이트 배열입니다.

특성

설명

이 메서드는 X.509 인증서의 원시 바이트 배열을 사용하고 개체를 X509Certificate2 연결된 값으로 채우는 데 사용할 수 있습니다.

이 메서드는 바이트 배열만 허용하므로 Base64 인코딩 또는 DER로 인코딩된 X.509 인증서 또는 PFX/PKCS12 인증서를 포함하여 암호가 필요하지 않은 인증서 형식에만 사용할 수 있습니다. PFX/PKCS12 인증서에는 둘 이상의 인증서가 포함될 수 있습니다. 이 경우 프라이빗 키와 연결된 첫 번째 인증서가 사용되거나 프라이빗 키를 찾을 수 없는 경우 첫 번째 인증서가 사용됩니다.

적용 대상

Import(String)

주의

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

X509Certificate2 개체를 인증서 파일의 정보로 채웁니다.

public:
 override void Import(System::String ^ fileName);
public override 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 override void Import (string fileName);
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}")>]
override this.Import : string -> unit
Public Overrides Sub Import (fileName As String)

매개 변수

fileName
String

인증서 이름입니다.

특성

설명

이 메서드는 X.509 인증서를 나타내고 파일에 포함된 인증서로 개체를 채우는 X509Certificate2 .cer 확장명의 파일과 같은 인증서 파일을 사용합니다.

이 메서드는 Base64 인코딩 또는 DER로 인코딩된 X.509 인증서, PFX/PKCS12 인증서 및 Authenticode와 같은 서명자 인증서를 비롯한 여러 인증서 유형에서 사용할 수 있습니다. PFX/PKCS12 인증서에는 둘 이상의 인증서가 포함될 수 있습니다. 이 경우 프라이빗 키와 연결된 첫 번째 인증서가 사용되거나 프라이빗 키를 찾을 수 없는 경우 첫 번째 인증서가 사용됩니다.

적용 대상

Import(Byte[], SecureString, X509KeyStorageFlags)

주의

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

중요

이 API는 CLS 규격이 아닙니다.

바이트 배열 데이터, 암호 및 키 스토리지 플래그를 사용하여 X509Certificate2 개체를 채웁니다.

public:
 override void Import(cli::array <System::Byte> ^ rawData, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public override 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 override void Import (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public override void Import (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public override void Import (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[<System.CLSCompliant(false)>]
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}")>]
override this.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 Overrides Sub Import (rawData As Byte(), password As SecureString, keyStorageFlags As X509KeyStorageFlags)

매개 변수

rawData
Byte[]

X.509 인증서의 데이터가 들어 있는 바이트 배열입니다.

password
SecureString

X.509 인증서 데이터에 액세스하는 데 필요한 암호입니다.

keyStorageFlags
X509KeyStorageFlags

인증서를 가져올 위치 및 방법을 제어하는 열거형 값의 비트 조합입니다.

특성

설명

Base64 인코딩 또는 DER로 인코딩된 X.509 인증서 또는 PFX/PKCS12 인증서와 같은 인증서 유형에 이 메서드를 사용할 수 있습니다. PFX/PKCS12 인증서에는 둘 이상의 인증서가 포함될 수 있습니다. 이 경우 프라이빗 키와 연결된 첫 번째 인증서가 사용되거나 프라이빗 키를 찾을 수 없는 경우 첫 번째 인증서가 사용됩니다.

중요

소스 코드 내에서 암호를 하드 코딩하지 마세요. 하드 코딩된 암호는 Ildasm.exe(IL 디스어셈블러), 16진수 편집기를 사용하거나 Notepad.exe 같은 텍스트 편집기에서 어셈블리를 열어 어셈블리에서 검색할 수 있습니다.

적용 대상

Import(Byte[], String, X509KeyStorageFlags)

주의

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

바이트 배열의 데이터, 암호 및 프라이빗 키를 가져오는 방법을 결정하기 위한 플래그를 사용하여 X509Certificate2 개체를 채웁니다.

public:
 override void Import(cli::array <System::Byte> ^ rawData, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public override 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 override void Import (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public override void Import (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
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}")>]
override this.Import : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Overrides Sub Import (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags)

매개 변수

rawData
Byte[]

X.509 인증서의 데이터가 들어 있는 바이트 배열입니다.

password
String

X.509 인증서 데이터에 액세스하는 데 필요한 암호입니다.

keyStorageFlags
X509KeyStorageFlags

인증서를 가져올 위치 및 방법을 제어하는 열거형 값의 비트 조합입니다.

특성

예제

다음 코드 예제에서는 인증서 파일을 인수로 사용하고 다양한 인증서 속성을 콘솔에 출력하는 명령줄 실행 파일을 만듭니다.

#using <System.dll>

using namespace System;
using namespace System::Security::Cryptography;
using namespace System::Security::Permissions;
using namespace System::IO;
using namespace System::Security::Cryptography::X509Certificates;

//Reads a file.
array<Byte>^ ReadFile( String^ fileName )
{
   FileStream^ f = gcnew FileStream( fileName,FileMode::Open,FileAccess::Read );
   int size = (int)f->Length;
   array<Byte>^data = gcnew array<Byte>(size);
   size = f->Read( data, 0, size );
   f->Close();
   return data;
}

[SecurityPermissionAttribute(SecurityAction::LinkDemand, Unrestricted = true)]
int main()
{
   array<String^>^args = Environment::GetCommandLineArgs();

   //Test for correct number of arguments.
   if ( args->Length < 2 )
   {
      Console::WriteLine( "Usage: CertInfo <filename>" );
      return  -1;
   }

   try
   {
      System::Security::Cryptography::X509Certificates::X509Certificate2 ^ x509 =
            gcnew System::Security::Cryptography::X509Certificates::X509Certificate2;

      //Create X509Certificate2 object from .cer file.
      array<Byte>^rawData = ReadFile( args[ 1 ] );

      x509->Import(rawData);

      //Print to console information contained in the certificate.
      Console::WriteLine( "{0}Subject: {1}{0}", Environment::NewLine, x509->Subject );
      Console::WriteLine( "{0}Issuer: {1}{0}", Environment::NewLine, x509->Issuer );
      Console::WriteLine( "{0}Version: {1}{0}", Environment::NewLine, x509->Version );
      Console::WriteLine( "{0}Valid Date: {1}{0}", Environment::NewLine, x509->NotBefore );
      Console::WriteLine( "{0}Expiry Date: {1}{0}", Environment::NewLine, x509->NotAfter );
      Console::WriteLine( "{0}Thumbprint: {1}{0}", Environment::NewLine, x509->Thumbprint );
      Console::WriteLine( "{0}Serial Number: {1}{0}", Environment::NewLine, x509->SerialNumber );
      Console::WriteLine( "{0}Friendly Name: {1}{0}", Environment::NewLine, x509->PublicKey->Oid->FriendlyName );
      Console::WriteLine( "{0}Public Key Format: {1}{0}", Environment::NewLine, x509->PublicKey->EncodedKeyValue->Format(true) );
      Console::WriteLine( "{0}Raw Data Length: {1}{0}", Environment::NewLine, x509->RawData->Length );
      Console::WriteLine( "{0}Certificate to string: {1}{0}", Environment::NewLine, x509->ToString( true ) );
      Console::WriteLine( "{0}Certificate to XML String: {1}{0}", Environment::NewLine, x509->PublicKey->Key->ToXmlString( false ) );

      //Add the certificate to a X509Store.
      X509Store ^ store = gcnew X509Store;
      store->Open( OpenFlags::MaxAllowed );
      store->Add( x509 );
      store->Close();
   }
   catch ( DirectoryNotFoundException^ )
   {
      Console::WriteLine( "Error: The directory specified could not be found." );
   }
   catch ( IOException^ )
   {
      Console::WriteLine( "Error: A file in the directory could not be accessed." );
   }
   catch ( NullReferenceException^ )
   {
      Console::WriteLine( "File must be a .cer file. Program does not have access to that type of file." );
   }

}
using System;
using System.Security.Cryptography;
using System.Security.Permissions;
using System.IO;
using System.Security.Cryptography.X509Certificates;

class CertInfo
{
    //Reads a file.
    internal static byte[] ReadFile (string fileName)
    {
        FileStream f = new FileStream(fileName, FileMode.Open, FileAccess.Read);
        int size = (int)f.Length;
        byte[] data = new byte[size];
        size = f.Read(data, 0, size);
        f.Close();
        return data;
    }
    //Main method begins here.
    static void Main(string[] args)
    {
        //Test for correct number of arguments.
        if (args.Length < 1)
        {
            Console.WriteLine("Usage: CertInfo <filename>");
            return;
        }
        try
        {
            X509Certificate2 x509 = new X509Certificate2();
            //Create X509Certificate2 object from .cer file.
            byte[] rawData = ReadFile(args[0]);
            x509.Import(rawData);

            //Print to console information contained in the certificate.
            Console.WriteLine("{0}Subject: {1}{0}", Environment.NewLine, x509.Subject);
            Console.WriteLine("{0}Issuer: {1}{0}", Environment.NewLine, x509.Issuer);
            Console.WriteLine("{0}Version: {1}{0}", Environment.NewLine, x509.Version);
            Console.WriteLine("{0}Valid Date: {1}{0}", Environment.NewLine, x509.NotBefore);
            Console.WriteLine("{0}Expiry Date: {1}{0}", Environment.NewLine, x509.NotAfter);
            Console.WriteLine("{0}Thumbprint: {1}{0}", Environment.NewLine, x509.Thumbprint);
            Console.WriteLine("{0}Serial Number: {1}{0}", Environment.NewLine, x509.SerialNumber);
            Console.WriteLine("{0}Friendly Name: {1}{0}", Environment.NewLine, x509.PublicKey.Oid.FriendlyName);
            Console.WriteLine("{0}Public Key Format: {1}{0}", Environment.NewLine, x509.PublicKey.EncodedKeyValue.Format(true));
            Console.WriteLine("{0}Raw Data Length: {1}{0}", Environment.NewLine, x509.RawData.Length);
            Console.WriteLine("{0}Certificate to string: {1}{0}", Environment.NewLine, x509.ToString(true));
            Console.WriteLine("{0}Certificate to XML String: {1}{0}", Environment.NewLine, x509.PublicKey.Key.ToXmlString(false));

            //Add the certificate to a X509Store.
            X509Store store = new X509Store();
            store.Open(OpenFlags.MaxAllowed);
            store.Add(x509);
            store.Close();
        }
        catch (DirectoryNotFoundException)
        {
               Console.WriteLine("Error: The directory specified could not be found.");
        }
        catch (IOException)
        {
            Console.WriteLine("Error: A file in the directory could not be accessed.");
        }
        catch (NullReferenceException)
        {
            Console.WriteLine("File must be a .cer file. Program does not have access to that type of file.");
        }
    }
}
Imports System.Security.Cryptography
Imports System.Security.Permissions
Imports System.IO
Imports System.Security.Cryptography.X509Certificates

Class CertInfo

    'Reads a file.
    Friend Shared Function ReadFile(ByVal fileName As String) As Byte()
        Dim f As New FileStream(fileName, FileMode.Open, FileAccess.Read)
        Dim size As Integer = Fix(f.Length)
        Dim data(size - 1) As Byte
        size = f.Read(data, 0, size)
        f.Close()
        Return data

    End Function 

    <SecurityPermission(SecurityAction.LinkDemand, Unrestricted:=True)> _
    Shared Sub Main(ByVal args() As String)
        'Test for correct number of arguments.
        If args.Length < 1 Then
            Console.WriteLine("Usage: CertInfo <filename>")
            Return
        End If
        Try
            Dim x509 As New X509Certificate2()
            'Create X509Certificate2 object from .cer file.
            Dim rawData As Byte() = ReadFile(args(0))
            
            x509.Import(rawData)

            'Print to console information contained in the certificate.
            Console.WriteLine("{0}Subject: {1}{0}", Environment.NewLine, x509.Subject)
            Console.WriteLine("{0}Issuer: {1}{0}", Environment.NewLine, x509.Issuer)
            Console.WriteLine("{0}Version: {1}{0}", Environment.NewLine, x509.Version)
            Console.WriteLine("{0}Valid Date: {1}{0}", Environment.NewLine, x509.NotBefore)
            Console.WriteLine("{0}Expiry Date: {1}{0}", Environment.NewLine, x509.NotAfter)
            Console.WriteLine("{0}Thumbprint: {1}{0}", Environment.NewLine, x509.Thumbprint)
            Console.WriteLine("{0}Serial Number: {1}{0}", Environment.NewLine, x509.SerialNumber)
            Console.WriteLine("{0}Friendly Name: {1}{0}", Environment.NewLine, x509.PublicKey.Oid.FriendlyName)
            Console.WriteLine("{0}Public Key Format: {1}{0}", Environment.NewLine, x509.PublicKey.EncodedKeyValue.Format(True))
            Console.WriteLine("{0}Raw Data Length: {1}{0}", Environment.NewLine, x509.RawData.Length)
            Console.WriteLine("{0}Certificate to string: {1}{0}", Environment.NewLine, x509.ToString(True))

            Console.WriteLine("{0}Certificate to XML String: {1}{0}", Environment.NewLine, x509.PublicKey.Key.ToXmlString(False))

            'Add the certificate to a X509Store.
            Dim store As New X509Store()
            store.Open(OpenFlags.MaxAllowed)
            store.Add(x509)
            store.Close()

        Catch dnfExcept As DirectoryNotFoundException
            Console.WriteLine("Error: The directory specified could not be found.")
        Catch ioExpcept As IOException
            Console.WriteLine("Error: A file in the directory could not be accessed.")
        Catch nrExcept As NullReferenceException
            Console.WriteLine("File must be a .cer file. Program does not have access to that type of file.")
        End Try

    End Sub
End Class

설명

이 메서드는 바이트 배열로 표시되는 인증서의 암호를 사용하여 개체를 채우는 X509Certificate2 데 사용할 수 있습니다. 이 X509KeyStorageFlags 값을 사용하여 프라이빗 키를 가져올 위치와 방법을 제어할 수 있습니다.

이 메서드는 바이트 배열을 허용하며 Base64 인코딩 또는 DER로 인코딩된 X.509 인증서 또는 PFX/PKCS12 인증서와 같은 인증서 형식에 사용할 수 있습니다. PFX/PKCS12 인증서에는 둘 이상의 인증서가 포함될 수 있습니다. 이 경우 프라이빗 키와 연결된 첫 번째 인증서가 사용되거나 프라이빗 키를 찾을 수 없는 경우 첫 번째 인증서가 사용됩니다.

중요

소스 코드 내에서 암호를 하드 코딩하지 마세요. 하드 코딩된 암호는 Ildasm.exe(IL 디스어셈블러), 16진수 편집기를 사용하거나 Notepad.exe 같은 텍스트 편집기에서 어셈블리를 열어 어셈블리에서 검색할 수 있습니다.

적용 대상

Import(String, SecureString, X509KeyStorageFlags)

주의

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

중요

이 API는 CLS 규격이 아닙니다.

인증서 파일의 정보, 암호 및 키 스토리지 플래그로 X509Certificate2 개체를 채웁니다.

public:
 override void Import(System::String ^ fileName, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public override 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 override void Import (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public override void Import (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public override void Import (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[<System.CLSCompliant(false)>]
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}")>]
override this.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 Overrides Sub Import (fileName As String, password As SecureString, keyStorageFlags As X509KeyStorageFlags)

매개 변수

fileName
String

인증서 파일의 이름입니다.

password
SecureString

X.509 인증서 데이터에 액세스하는 데 필요한 암호입니다.

keyStorageFlags
X509KeyStorageFlags

인증서를 가져올 위치 및 방법을 제어하는 열거형 값의 비트 조합입니다.

특성

설명

보안 참고 사항 소스 코드 내에서 암호를 하드 코딩하지 마세요. 하드 코딩된 암호는 Ildasm.exe(IL 디스어셈블러), 16진수 편집기를 사용하거나 Notepad.exe 같은 텍스트 편집기에서 어셈블리를 열어 어셈블리에서 검색할 수 있습니다.

적용 대상

Import(String, String, X509KeyStorageFlags)

주의

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

X509Certificate2 개체를 인증서 파일의 정보, 암호 및 X509KeyStorageFlags 값으로 채웁니다.

public:
 override void Import(System::String ^ fileName, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public override 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 override void Import (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public override void Import (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
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}")>]
override this.Import : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> unit
Public Overrides Sub Import (fileName As String, password As String, keyStorageFlags As X509KeyStorageFlags)

매개 변수

fileName
String

인증서 파일의 이름입니다.

password
String

X.509 인증서 데이터에 액세스하는 데 필요한 암호입니다.

keyStorageFlags
X509KeyStorageFlags

인증서를 가져올 위치 및 방법을 제어하는 열거형 값의 비트 조합입니다.

특성

설명

이 메서드는 인증서 파일, 암호 및 X509KeyStorageFlags 값의 정보로 개체를 채우는 X509Certificate2 데 사용할 수 있습니다.

중요

소스 코드 내에서 암호를 하드 코딩하지 마세요. 하드 코딩된 암호는 Ildasm.exe(IL 디스어셈블러), 16진수 편집기를 사용하거나 Notepad.exe 같은 텍스트 편집기에서 어셈블리를 열어 어셈블리에서 검색할 수 있습니다.

적용 대상