Udostępnij za pośrednictwem


RSAOAEPKeyExchangeFormatter.SetKey(AsymmetricAlgorithm) Metoda

Definicja

Ustawia klucz publiczny, który ma być używany do szyfrowania danych wymiany kluczy.

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)

Parametry

key
AsymmetricAlgorithm

Wystąpienie algorytmu RSA zawierającego klucz publiczny.

Wyjątki

key to null.

Przykłady

W poniższym przykładzie kodu pokazano, jak za pomocą SetKey metody ustawić RSA klucz na potrzeby odszyfrowywania. Ten przykład kodu jest częścią większego przykładu podanego RSAOAEPKeyExchangeFormatter dla klasy.

RSA^ key = RSA::Create();
rsaFormatter->SetKey( key );
RSA key = RSA.Create();
rsaFormatter.SetKey(key);
Dim key As RSA = RSA.Create()
rsaFormatter.SetKey(key)

Uwagi

Przed wywołaniem metody CreateKeyExchangenależy ustawić klucz .

Dotyczy

Zobacz też