語言

RSA.ImportRSAPrivateKey(ReadOnlySpan<Byte>, Int32) 方法

定義

解密後,從 PKCS#1 RSAPrivateKey 結構匯入公私鑰對,替換此物件的金鑰。

public:
 virtual void ImportRSAPrivateKey(ReadOnlySpan<System::Byte> source, [Runtime::InteropServices::Out] int % bytesRead);
public virtual void ImportRSAPrivateKey(ReadOnlySpan<byte> source, out int bytesRead);
abstract member ImportRSAPrivateKey : ReadOnlySpan<byte> * int -> unit
override this.ImportRSAPrivateKey : ReadOnlySpan<byte> * int -> unit
Public Overridable Sub ImportRSAPrivateKey (source As ReadOnlySpan(Of Byte), ByRef bytesRead As Integer)

參數

source
ReadOnlySpan<Byte>

ASN.1-BER 編碼中 PKCS#1 RSAPrivateKey 結構的位元組。

bytesRead
Int32

當此方法回傳時,包含一個表示從 讀取 source的位元組數的值。 此參數被視為未初始化。

例外狀況

的內容 source 並不代表 ASN.1-BER 編碼的 PKCS#1 RSAPrivateKey 結構。

-或-

金鑰匯入失敗了。

備註

此方法僅支援 RSAPrivateKey 的二進位(BER/CER/DER)編碼。 若值為 Base64 編碼或 PEM 文字格式,呼叫者必須先對內容進行 Base64 解碼,然後再呼叫此方法。

適用於