X509Certificate2Collection.Export 方法

定義

將以內容類型為基礎的 X.509 憑證資訊匯出至位元組陣列。

多載

Export(X509ContentType, String)

使用密碼將 X.509 憑證資訊匯出至位元組陣列。

Export(X509ContentType)

將 X.509 憑證資訊匯出至位元組陣列。

Export(X509ContentType, String)

來源:
X509Certificate2Collection.cs
來源:
X509Certificate2Collection.cs
來源:
X509Certificate2Collection.cs

使用密碼將 X.509 憑證資訊匯出至位元組陣列。

public byte[]? Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string? password);
public byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string password);

參數

contentType
X509ContentType

支援的 X509ContentType 物件。

password
String

用於保護位元組陣列的字串。

傳回

Byte[]

位元組陣列中的 X.509 憑證資訊。

例外狀況

無法讀取憑證、內容無效,或者在憑證需要密碼的情況下,因為提供的密碼不正確而無法匯出私密金鑰。

備註

這個方法支援下列X509ContentType類型:

適用於

.NET 9 及其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

Export(X509ContentType)

來源:
X509Certificate2Collection.cs
來源:
X509Certificate2Collection.cs
來源:
X509Certificate2Collection.cs

將 X.509 憑證資訊匯出至位元組陣列。

public byte[]? Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);
public byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);

參數

contentType
X509ContentType

支援的 X509ContentType 物件。

傳回

Byte[]

位元組陣列中的 X.509 憑證資訊。

備註

此方法支援不需要密碼的內容類型。

適用於

.NET 9 及其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1