AsymmetricAlgorithm.TryExportPkcs8PrivateKeyPem 方法

定義

嘗試將 PEM 編碼 PKCS#8 PrivateKeyInfo 格式中的目前金鑰匯出至提供的緩衝區。

public:
 bool TryExportPkcs8PrivateKeyPem(Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryExportPkcs8PrivateKeyPem (Span<char> destination, out int charsWritten);
member this.TryExportPkcs8PrivateKeyPem : Span<char> * int -> bool
Public Function TryExportPkcs8PrivateKeyPem (destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

參數

destination
Span<Char>

要接收 PEM 編碼 PKCS#8 PrivateKeyInfo 資料的字元範圍。

charsWritten
Int32

當這個方法傳回時,會包含值,指出寫入 的 destination 字元數。 這個參數會被視為未初始化。

傳回

destination 夠大可接收輸出,則為 true;否則為 false

例外狀況

無法匯出金鑰。

備註

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

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

適用於