ערוך

שתף באמצעות


InMemorySymmetricSecurityKey.GenerateDerivedKey Method

Definition

Generates a derived key using the specified cryptographic algorithm and parameters for the current key.

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

Parameters

algorithm
String

A URI that represents the cryptographic algorithm to use to generate the derived key.

label
Byte[]

An array of Byte that contains the label parameter for the cryptographic algorithm.

nonce
Byte[]

An array of Byte that contains the nonce that is used to create a derived key.

derivedKeyLength
Int32

The size of the derived key.

offset
Int32

The position at which the derived key is located in the byte array that is returned from this method.

Returns

Byte[]

An array of Byte that contains the derived key.

Exceptions

algorithm is not supported. The supported algorithms is Psha1KeyDerivation.

Remarks

To specify P-SHA1 as the cryptographic algorithm, use the Psha1KeyDerivation field.

Due to collision problems with SHA1, Microsoft recommends a security model based on SHA256 or better.

Applies to