InMemorySymmetricSecurityKey.GenerateDerivedKey Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
- 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
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.