DSA.ImportSubjectPublicKeyInfo(ReadOnlySpan<Byte>, Int32) 方法

定義

解密後,從 X.509 SubjectPublicKeyInfo 結構匯入公開金鑰,以取代這個物件的金鑰。

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

參數

source
ReadOnlySpan<Byte>

以 ASN.1-DER 編碼的 X.509 SubjectPublicKeyInfo 結構位元組。

bytesRead
Int32

當此方法傳回時,會包含一個值,指出讀取自 source 的位元組數。 這個參數會被視為未初始化。

例外狀況

source 的內容不表示 ASN.1-DER 編碼的 X.509 SubjectPublicKeyInfo 結構。

-或-

source 的內容指出金鑰適用於這個執行個體所表示演算法以外的演算法。

-或-

source 的內容表示金鑰的格式不受支援。

-或-

演算法專屬金鑰匯入失敗。

備註

這個方法僅支援 SubjectPublicKeyInfo 的二進位 (DER) 編碼。 如果值為 Base64 編碼或 PEM 文字格式,則呼叫端必須在呼叫此方法之前先將內容解碼為 Base64。

適用於