AsymmetricAlgorithm.ExportEncryptedPkcs8PrivateKeyPem 方法

定義

多載

ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters)

使用字元型密碼 PEM 編碼,以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前的金鑰。

ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters)

使用以位元組為基礎的密碼 PEM 編碼,以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前的金鑰。

ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Char>, PbeParameters)

來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs

使用字元型密碼 PEM 編碼,以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前的金鑰。

public:
 System::String ^ ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public string ExportEncryptedPkcs8PrivateKeyPem (ReadOnlySpan<char> password, System.Security.Cryptography.PbeParameters pbeParameters);
member this.ExportEncryptedPkcs8PrivateKeyPem : ReadOnlySpan<char> * System.Security.Cryptography.PbeParameters -> string
Public Function ExportEncryptedPkcs8PrivateKeyPem (password As ReadOnlySpan(Of Char), pbeParameters As PbeParameters) As String

參數

password
ReadOnlySpan<Char>

加密金鑰產製原料時要使用的密碼。

pbeParameters
PbeParameters

加密金鑰產製原料時要使用的密碼型加密 (PBE) 參數。

傳回

包含 PEM 編碼 PKCS#8 EncryptedPrivateKeyInfo 的字串。

例外狀況

無法匯出金鑰。

備註

pbeParameters 指出使用 PBKDF2 (密碼型金鑰衍生函數 2) 的演算法時,密碼會透過 UTF-8 編碼轉換成位元組。

          A PEM-encoded PKCS#8 EncryptedPrivateKeyInfo will begin with
         `-----BEGIN ENCRYPTED PRIVATE KEY-----` and end with
         `-----END ENCRYPTED PRIVATE KEY-----`, with the base64 encoded DER
          contents of the key between the PEM boundaries.

          The PEM is encoded according to the IETF RFC 7468 "strict" encoding rules.

適用於

ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<Byte>, PbeParameters)

來源:
AsymmetricAlgorithm.cs
來源:
AsymmetricAlgorithm.cs

使用以位元組為基礎的密碼 PEM 編碼,以 PKCS#8 EncryptedPrivateKeyInfo 格式匯出目前的金鑰。

public:
 System::String ^ ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<System::Byte> passwordBytes, System::Security::Cryptography::PbeParameters ^ pbeParameters);
public string ExportEncryptedPkcs8PrivateKeyPem (ReadOnlySpan<byte> passwordBytes, System.Security.Cryptography.PbeParameters pbeParameters);
member this.ExportEncryptedPkcs8PrivateKeyPem : ReadOnlySpan<byte> * System.Security.Cryptography.PbeParameters -> string
Public Function ExportEncryptedPkcs8PrivateKeyPem (passwordBytes As ReadOnlySpan(Of Byte), pbeParameters As PbeParameters) As String

參數

passwordBytes
ReadOnlySpan<Byte>

加密金鑰內容時要用作密碼的位元組。

pbeParameters
PbeParameters

加密金鑰產製原料時要使用的密碼型加密 (PBE) 參數。

傳回

包含 PEM 編碼 PKCS#8 EncryptedPrivateKeyInfo 的字串。

例外狀況

無法匯出金鑰。

備註

PEM 編碼的 PKCS#8 EncryptedPrivateKeyInfo 會以 開頭 -----BEGIN ENCRYPTED PRIVATE KEY----- 和結尾 -----END ENCRYPTED PRIVATE KEY----- ,且 PEM 界限之間金鑰的 base64 編碼 DER 內容。

PEM 會根據 IETF RFC 7468「strict」 編碼規則進行編碼。

適用於