Muokkaa

Jaa


SymmetricSecurityKey.GenerateDerivedKey Method

Definition

When overridden in a derived class, generates a derived key using the specified cryptographic algorithm and parameters for the current key.

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()

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.

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