X509Certificate2Collection.Export 方法
本文內容
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將以內容類型為基礎的 X.509 憑證資訊匯出至位元組陣列。
Export(X509ContentType, String) |
使用密碼將 X.509 憑證資訊匯出至位元組陣列。 |
Export(X509ContentType) |
將 X.509 憑證資訊匯出至位元組陣列。 |
使用密碼將 X.509 憑證資訊匯出至位元組陣列。
public:
cli::array <System::Byte> ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType, System::String ^ password);
public byte[]? Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string? password);
public byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType, string password);
member this.Export : System.Security.Cryptography.X509Certificates.X509ContentType * string -> byte[]
Public Function Export (contentType As X509ContentType, password As String) As Byte()
參數
- 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 |
將 X.509 憑證資訊匯出至位元組陣列。
public:
cli::array <System::Byte> ^ Export(System::Security::Cryptography::X509Certificates::X509ContentType contentType);
public byte[]? Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);
public byte[] Export (System.Security.Cryptography.X509Certificates.X509ContentType contentType);
member this.Export : System.Security.Cryptography.X509Certificates.X509ContentType -> byte[]
Public Function Export (contentType As X509ContentType) As Byte()
參數
- 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 |