Bagikan melalui


X509Certificate Konstruktor

Definisi

Menginisialisasi instans baru kelas X509Certificate.

Overload

X509Certificate()
Kedaluwarsa.
Kedaluwarsa.

Menginisialisasi instans baru kelas X509Certificate.

X509Certificate(Byte[])
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas yang ditentukan dari urutan byte yang mewakili sertifikat X.509v3.

X509Certificate(IntPtr)

Menginisialisasi instans X509Certificate baru kelas menggunakan handel ke struktur yang tidak terkelola PCCERT_CONTEXT .

X509Certificate(X509Certificate)

Menginisialisasi instans X509Certificate baru kelas menggunakan kelas lain X509Certificate .

X509Certificate(String)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file bertanda tangan PKCS7.

X509Certificate(Byte[], SecureString)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte dan kata sandi.

X509Certificate(Byte[], String)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte dan kata sandi.

X509Certificate(SerializationInfo, StreamingContext)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan SerializationInfo objek dan StreamingContext struktur.

X509Certificate(String, SecureString)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file sertifikat dan kata sandi.

X509Certificate(String, String)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file yang ditandatangani PKCS7 dan kata sandi untuk mengakses sertifikat.

X509Certificate(Byte[], SecureString, X509KeyStorageFlags)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte, kata sandi, dan bendera penyimpanan kunci.

X509Certificate(Byte[], String, X509KeyStorageFlags)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte, kata sandi, dan bendera penyimpanan kunci.

X509Certificate(String, SecureString, X509KeyStorageFlags)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file sertifikat, kata sandi, dan bendera penyimpanan kunci.

X509Certificate(String, String, X509KeyStorageFlags)
Kedaluwarsa.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file yang ditandatangani PKCS7, kata sandi untuk mengakses sertifikat, dan bendera penyimpanan kunci.

X509Certificate()

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Perhatian

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

Menginisialisasi instans baru kelas X509Certificate.

public:
 X509Certificate();
public X509Certificate ();
[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 X509Certificate ();
[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}")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate ();
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Obsolete("X509Certificate and X509Certificate2 are immutable. Use X509CertificateLoader to create a new certificate.", DiagnosticId="SYSLIB0026", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public X509Certificate ();
Public Sub New ()
Atribut

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Berlaku untuk

X509Certificate(Byte[])

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Menginisialisasi instans X509Certificate baru kelas yang ditentukan dari urutan byte yang mewakili sertifikat X.509v3.

public:
 X509Certificate(cli::array <System::Byte> ^ data);
public X509Certificate (byte[] data);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (byte[] data);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (byte[] data);
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (data As Byte())

Parameter

data
Byte[]

Array byte yang berisi data dari sertifikat X.509.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya rawData adalah null.

-atau-

Panjang rawData parameter adalah 0.

Contoh

Contoh berikut memuat file sertifikat X.509 ke dalam X509Certificate objek, mengekspor sertifikat sebagai array byte, lalu mengimpor array byte ke objek lain X509Certificate .

using namespace System;
using namespace System::Security::Cryptography::X509Certificates;
int main()
{
   
   // The path to the certificate.
   String^ Certificate = L"test.pfx";
   
   // Load the certificate into an X509Certificate object.
   X509Certificate^ cert = gcnew X509Certificate( Certificate );
   array<Byte>^certData = cert->Export( X509ContentType::Cert );
   X509Certificate^ newCert = gcnew X509Certificate( certData );
   
   // Get the value.
   String^ resultsTrue = newCert->ToString( true );
   
   // Display the value to the console.
   Console::WriteLine( resultsTrue );
   
   // Get the value.
   String^ resultsFalse = newCert->ToString( false );
   
   // Display the value to the console.
   Console::WriteLine( resultsFalse );
}
using System;
using System.Security.Cryptography.X509Certificates;

public class X509
{

    public static void Main()
    {

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

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

        byte[] certData = cert.Export(X509ContentType.Cert);

        X509Certificate newCert = new X509Certificate(certData);

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

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

        // Get the value.
        string resultsFalse = newCert.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 = "test.pfx"

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


        Dim certData As Byte() = cert.Export(X509ContentType.Cert)

        Dim newCert As New X509Certificate(certData)

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

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

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

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

    End Sub
End Module

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk data, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat dalam penyimpanan.

Berlaku untuk

X509Certificate(IntPtr)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Menginisialisasi instans X509Certificate baru kelas menggunakan handel ke struktur yang tidak terkelola PCCERT_CONTEXT .

public:
 X509Certificate(IntPtr handle);
public X509Certificate (IntPtr handle);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (IntPtr handle);
[System.Security.SecurityCritical]
public X509Certificate (IntPtr handle);
new System.Security.Cryptography.X509Certificates.X509Certificate : nativeint -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : nativeint -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Security.SecurityCritical>]
new System.Security.Cryptography.X509Certificates.X509Certificate : nativeint -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (handle As IntPtr)

Parameter

handle
IntPtr

nativeint

Handel ke struktur yang tidak terkelola PCCERT_CONTEXT .

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameter handel tidak mewakili struktur yang valid PCCERT_CONTEXT .

Keterangan

Konstruktor ini membuat objek baru X509Certificate menggunakan handel untuk konteks sertifikat API Kriptografi Microsoft, PCCERT_CONTEXT.

Penting

Konstruktor ini membuat salinan konteks sertifikat. Jangan berasumsi bahwa struktur konteks yang Anda berikan ke konstruktor valid; mungkin telah dirilis. Anda bisa mendapatkan salinan struktur saat ini PCCERT_CONTEXT dari Handle properti , tetapi hanya berlaku selama masa X509Certificate pakai objek.

Berlaku untuk

X509Certificate(X509Certificate)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Menginisialisasi instans X509Certificate baru kelas menggunakan kelas lain X509Certificate .

public:
 X509Certificate(System::Security::Cryptography::X509Certificates::X509Certificate ^ cert);
public X509Certificate (System.Security.Cryptography.X509Certificates.X509Certificate cert);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (System.Security.Cryptography.X509Certificates.X509Certificate cert);
new System.Security.Cryptography.X509Certificates.X509Certificate : System.Security.Cryptography.X509Certificates.X509Certificate -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : System.Security.Cryptography.X509Certificates.X509Certificate -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (cert As X509Certificate)

Parameter

cert
X509Certificate

Kelas X509Certificate untuk menginisialisasi kelas ini.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Nilai cert parameter adalah null.

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Berlaku untuk

X509Certificate(String)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file bertanda tangan PKCS7.

public:
 X509Certificate(System::String ^ fileName);
public X509Certificate (string fileName);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (string fileName);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (string fileName);
new System.Security.Cryptography.X509Certificates.X509Certificate : string -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (fileName As String)

Parameter

fileName
String

Nama file bertanda tangan PKCS7.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya fileName adalah null.

Contoh

Contoh berikut memuat sertifikat X.509 dari file, memanggil ToString metode , dan menampilkan hasilnya ke konsol.

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( 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;

public class X509
{

    public static void Main()
    {

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

        // Load the certificate into an X509Certificate object.
        X509Certificate cert = new X509Certificate(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(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

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk fileName, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat dalam penyimpanan.

Berlaku untuk

X509Certificate(Byte[], SecureString)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Penting

API ini bukan kompatibel CLS.

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte dan kata sandi.

public:
 X509Certificate(cli::array <System::Byte> ^ rawData, System::Security::SecureString ^ password);
[System.CLSCompliant(false)]
public X509Certificate (byte[] rawData, System.Security.SecureString? password);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (byte[] rawData, System.Security.SecureString? password);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (byte[] rawData, System.Security.SecureString? password);
[System.CLSCompliant(false)]
public X509Certificate (byte[] rawData, System.Security.SecureString password);
public X509Certificate (byte[] rawData, System.Security.SecureString password);
[<System.CLSCompliant(false)>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (rawData As Byte(), password As SecureString)

Parameter

rawData
Byte[]

Array byte yang berisi data dari sertifikat X.509.

password
SecureString

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya rawData adalah null.

-atau-

Panjang rawData parameter adalah 0.

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Penting

Jangan pernah mengodekan kata sandi secara permanen dalam kode sumber Anda. Kata sandi yang dikodekan secara permanen dapat diambil dari perakitan menggunakan Ildasm.exe (IL Disassembler), editor hex, atau hanya dengan membuka assembly di editor teks seperti Notepad.exe.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk rawData, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(Byte[], String)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte dan kata sandi.

public:
 X509Certificate(cli::array <System::Byte> ^ rawData, System::String ^ password);
public X509Certificate (byte[] rawData, string? password);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (byte[] rawData, string? password);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (byte[] rawData, string? password);
public X509Certificate (byte[] rawData, string password);
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (rawData As Byte(), password As String)

Parameter

rawData
Byte[]

Array byte yang berisi data dari sertifikat X.509.

password
String

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya rawData adalah null.

-atau-

Panjang rawData parameter adalah 0.

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Penting

Jangan pernah mengodekan kata sandi secara permanen dalam kode sumber Anda. Kata sandi yang dikodekan secara permanen dapat diambil dari perakitan menggunakan Ildasm.exe (IL Disassembler), editor hex, atau hanya dengan membuka perakitan di editor teks seperti Notepad.exe.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk rawData, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(SerializationInfo, StreamingContext)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Menginisialisasi instans X509Certificate baru kelas menggunakan SerializationInfo objek dan StreamingContext struktur.

public:
 X509Certificate(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
public X509Certificate (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public X509Certificate (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Security.Cryptography.X509Certificates.X509Certificate : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (info As SerializationInfo, context As StreamingContext)

Parameter

info
SerializationInfo

Objek SerializationInfo yang menjelaskan informasi serialisasi.

context
StreamingContext

StreamingContext Struktur yang menjelaskan bagaimana serialisasi harus dilakukan.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Berlaku untuk

X509Certificate(String, SecureString)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Penting

API ini bukan kompatibel CLS.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file sertifikat dan kata sandi.

public:
 X509Certificate(System::String ^ fileName, System::Security::SecureString ^ password);
[System.CLSCompliant(false)]
public X509Certificate (string fileName, System.Security.SecureString? password);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (string fileName, System.Security.SecureString? password);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (string fileName, System.Security.SecureString? password);
[System.CLSCompliant(false)]
public X509Certificate (string fileName, System.Security.SecureString password);
public X509Certificate (string fileName, System.Security.SecureString password);
[<System.CLSCompliant(false)>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (fileName As String, password As SecureString)

Parameter

fileName
String

Nama file sertifikat.

password
SecureString

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya fileName adalah null.

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini. Memanggil konstruktor ini dengan kata sandi yang benar mendekripsi kunci privat dan menyimpannya ke kontainer kunci.

Penting

Jangan pernah mengodekan kata sandi secara permanen dalam kode sumber Anda. Kata sandi yang dikodekan secara permanen dapat diambil dari perakitan menggunakan Ildasm.exe (IL Disassembler), editor hex, atau hanya dengan membuka perakitan di editor teks seperti Notepad.exe.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk fileName, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(String, String)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file yang ditandatangani PKCS7 dan kata sandi untuk mengakses sertifikat.

public:
 X509Certificate(System::String ^ fileName, System::String ^ password);
public X509Certificate (string fileName, string? password);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (string fileName, string? password);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (string fileName, string? password);
public X509Certificate (string fileName, string password);
new System.Security.Cryptography.X509Certificates.X509Certificate : string * string -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * string -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * string -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (fileName As String, password As String)

Parameter

fileName
String

Nama file bertanda tangan PKCS7.

password
String

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya fileName adalah null.

Keterangan

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini. Memanggil konstruktor ini dengan kata sandi yang benar mendekripsi kunci privat dan menyimpannya ke kontainer kunci.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk fileName, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(Byte[], SecureString, X509KeyStorageFlags)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Penting

API ini bukan kompatibel CLS.

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte, kata sandi, dan bendera penyimpanan kunci.

public:
 X509Certificate(cli::array <System::Byte> ^ rawData, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public X509Certificate (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (byte[] rawData, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public X509Certificate (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public X509Certificate (byte[] rawData, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[<System.CLSCompliant(false)>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (rawData As Byte(), password As SecureString, keyStorageFlags As X509KeyStorageFlags)

Parameter

rawData
Byte[]

Array byte yang berisi data dari sertifikat X.509.

password
SecureString

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

keyStorageFlags
X509KeyStorageFlags

Kombinasi bitwise dari nilai enumerasi yang mengontrol di mana dan bagaimana mengimpor sertifikat.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya rawData adalah null.

-atau-

Panjang rawData parameter adalah 0.

Keterangan

Memanggil konstruktor ini dengan kata sandi yang benar mendekripsi kunci privat dan menyimpannya ke Penyedia Layanan Kriptografi (CSP) MICROSOFT Cryptographic API.

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Penting

Jangan pernah mengodekan kata sandi secara permanen dalam kode sumber Anda. Kata sandi yang dikodekan secara permanen dapat diambil dari perakitan menggunakan Ildasm.exe (IL Disassembler), editor hex, atau hanya dengan membuka perakitan di editor teks seperti Notepad.exe.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk rawData, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(Byte[], String, X509KeyStorageFlags)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Menginisialisasi instans X509Certificate baru kelas menggunakan array byte, kata sandi, dan bendera penyimpanan kunci.

public:
 X509Certificate(cli::array <System::Byte> ^ rawData, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public X509Certificate (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (byte[] rawData, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public X509Certificate (byte[] rawData, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : byte[] * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (rawData As Byte(), password As String, keyStorageFlags As X509KeyStorageFlags)

Parameter

rawData
Byte[]

Array byte yang berisi data dari sertifikat X.509.

password
String

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

keyStorageFlags
X509KeyStorageFlags

Kombinasi bitwise dari nilai enumerasi yang mengontrol di mana dan bagaimana mengimpor sertifikat.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya rawData adalah null.

-atau-

Panjang rawData parameter adalah 0.

Keterangan

Konstruktor ini membuat objek baru X509Certificate menggunakan array byte, kata sandi yang diperlukan untuk mengakses data sertifikat, dan bendera penyimpanan kunci. Memanggil konstruktor ini dengan kata sandi yang benar mendekripsi kunci privat dan menyimpannya ke Penyedia Layanan Kriptografi (CSP) MICROSOFT Cryptographic API.

Nilai X509KeyStorageFlags dapat digunakan untuk mengontrol di mana dan bagaimana kunci privat diimpor.

ASN.1 DER adalah satu-satunya format sertifikat yang didukung oleh kelas ini.

Penting

Jangan pernah mengodekan kata sandi secara permanen dalam kode sumber Anda. Kata sandi yang dikodekan secara permanen dapat diambil dari perakitan menggunakan Ildasm.exe (IL Disassembler), editor hex, atau hanya dengan membuka perakitan di editor teks seperti Notepad.exe.

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk rawData, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(String, SecureString, X509KeyStorageFlags)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Penting

API ini bukan kompatibel CLS.

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file sertifikat, kata sandi, dan bendera penyimpanan kunci.

public:
 X509Certificate(System::String ^ fileName, System::Security::SecureString ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public X509Certificate (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (string fileName, System.Security.SecureString? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.CLSCompliant(false)]
public X509Certificate (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public X509Certificate (string fileName, System.Security.SecureString password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[<System.CLSCompliant(false)>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.CLSCompliant(false)>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
new System.Security.Cryptography.X509Certificates.X509Certificate : string * System.Security.SecureString * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (fileName As String, password As SecureString, keyStorageFlags As X509KeyStorageFlags)

Parameter

fileName
String

Nama file sertifikat.

password
SecureString

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

keyStorageFlags
X509KeyStorageFlags

Kombinasi bitwise dari nilai enumerasi yang mengontrol di mana dan bagaimana mengimpor sertifikat.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya fileName adalah null.

Keterangan

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk fileName, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk

X509Certificate(String, String, X509KeyStorageFlags)

Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs
Sumber:
X509Certificate.cs

Perhatian

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

Menginisialisasi instans X509Certificate baru kelas menggunakan nama file yang ditandatangani PKCS7, kata sandi untuk mengakses sertifikat, dan bendera penyimpanan kunci.

public:
 X509Certificate(System::String ^ fileName, System::String ^ password, System::Security::Cryptography::X509Certificates::X509KeyStorageFlags keyStorageFlags);
public X509Certificate (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public X509Certificate (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[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 X509Certificate (string fileName, string? password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
public X509Certificate (string fileName, string password, System.Security.Cryptography.X509Certificates.X509KeyStorageFlags keyStorageFlags);
new System.Security.Cryptography.X509Certificates.X509Certificate : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<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}")>]
new System.Security.Cryptography.X509Certificates.X509Certificate : string * string * System.Security.Cryptography.X509Certificates.X509KeyStorageFlags -> System.Security.Cryptography.X509Certificates.X509Certificate
Public Sub New (fileName As String, password As String, keyStorageFlags As X509KeyStorageFlags)

Parameter

fileName
String

Nama file bertanda tangan PKCS7.

password
String

Kata sandi yang diperlukan untuk mengakses data sertifikat X.509.

keyStorageFlags
X509KeyStorageFlags

Kombinasi bitwise dari nilai enumerasi yang mengontrol di mana dan bagaimana mengimpor sertifikat.

Atribut

Pengecualian

Terjadi kesalahan dengan sertifikat. Contohnya:

  • File sertifikat tidak ada.

  • Sertifikat tidak valid.

  • Kata sandi sertifikat salah.

Parameternya fileName adalah null.

Keterangan

Jika Anda membuat X509Certificate sertifikat dengan menentukan penyimpanan file yang ditandatangani PKCS7 untuk fileName, X509Certificate dibuat untuk sertifikat yang menandatangani penyimpanan daripada untuk salah satu sertifikat di dalam penyimpanan.

Berlaku untuk