Udostępnij za pośrednictwem


SymmetricSecurityKey.GenerateDerivedKey Metoda

Definicja

W przypadku zastąpienia w klasie pochodnej generuje klucz pochodny przy użyciu określonego algorytmu kryptograficznego i parametrów dla bieżącego klucza.

public:
 abstract cli::array <System::Byte> ^ GenerateDerivedKey(System::String ^ algorithm, cli::array <System::Byte> ^ label, cli::array <System::Byte> ^ nonce, int derivedKeyLength, int offset);
public abstract byte[] GenerateDerivedKey (string algorithm, byte[] label, byte[] nonce, int derivedKeyLength, int offset);
abstract member GenerateDerivedKey : string * byte[] * byte[] * int * int -> byte[]
Public MustOverride Function GenerateDerivedKey (algorithm As String, label As Byte(), nonce As Byte(), derivedKeyLength As Integer, offset As Integer) As Byte()

Parametry

algorithm
String

Identyfikator URI reprezentujący algorytm kryptograficzny używany do generowania klucza pochodnego.

label
Byte[]

Tablica zawierająca Byte parametr etykiety dla algorytmu kryptograficznego.

nonce
Byte[]

Tablica zawierająca Byte nietyp, który jest używany do utworzenia klucza pochodnego.

derivedKeyLength
Int32

Rozmiar klucza pochodnego.

offset
Int32

Położenie, w którym klucz pochodny znajduje się w tablicy bajtów zwracanej z tej metody.

Zwraca

Byte[]

Tablica zawierająca Byte klucz pochodny.

Uwagi

Aby określić algorytm P-SHA1 jako algorytm kryptograficzny, użyj Psha1KeyDerivation pola .

Ze względu na problemy z kolizją z algorytmem SHA1 firma Microsoft zaleca model zabezpieczeń oparty na algorytmie SHA256 lub lepszym.

Dotyczy