言語

RSAOAEPKeyExchangeFormatter.SetKey(AsymmetricAlgorithm) メソッド

定義

キー交換データの暗号化に使用する公開キーを設定します。

public:
 override void SetKey(System::Security::Cryptography::AsymmetricAlgorithm ^ key);
public override void SetKey(System.Security.Cryptography.AsymmetricAlgorithm key);
override this.SetKey : System.Security.Cryptography.AsymmetricAlgorithm -> unit
Public Overrides Sub SetKey (key As AsymmetricAlgorithm)

パラメーター

key
AsymmetricAlgorithm

公開キーを保持する RSA アルゴリズムのインスタンス。

例外

keynullです。

次のコード例では、 SetKey メソッドを使用して復号化用の RSA キーを設定する方法を示します。 このコード例は、 RSAOAEPKeyExchangeFormatter クラスに提供されるより大きな例の一部です。

RSA key = RSA.Create();
rsaFormatter.SetKey(key);
Dim key As RSA = RSA.Create()
rsaFormatter.SetKey(key)

注釈

CreateKeyExchangeを呼び出す前に、キーを設定する必要があります。

適用対象

こちらもご覧ください