語言

RSA.TryExportRSAPublicKeyPem(Span<Char>, Int32) 方法

定義

嘗試將目前的金鑰以 PEM 編碼的 PKCS#1 RSAPublicKey 格式匯出到提供的緩衝區。

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

參數

destination
Span<Char>

字元區間用於接收 PEM 編碼的 PKCS#1 RSAPublicKey 資料。

charsWritten
Int32

當此方法返回時,包含一個表示寫入 的 destination字元數的值。 此參數被視為未初始化。

傳回

true如果 destination 足夠大以接收輸出;否則,。 false

例外狀況

該金鑰無法匯出。

備註

一個以 PEM 編碼的 PKCS#1 RSAPublicKey 會以 開始 -----BEGIN RSA PUBLIC KEY----- ,結束於 -----END RSA PUBLIC KEY-----,鍵中 在 PEM 邊界之間以 base64 編碼的 DER 內容。

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

適用於