Share via


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字元數。 這個參數會被視為未初始化。

傳回

destination 夠大可接收輸出,則為 true;否則為 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.

適用於