Skip to main content

diagGenerateKeyFromSeed

Valid for: CANoe DE

Function Syntax

Description

Creates a key to execute secured diagnostic functions within devices. The key will be defined with the Seed of the device. If the computation takes more than 1 ms, diagStartGenerateKeyFromSeed in combination with the callback _Diag_GenerateKeyResult should be used.

Parameters

  • seedArray: Seed for the definition of the key.
  • seedArraySize: Number of bytes in the SeedArray.
  • securityLevel: Security level for which the key will be created.
  • variant: Variant of the diagnostic description.
  • ipOption: Optional parameter that will be forwarded to the customer function. If not used, an empty string ” ” must be given here. Further options that will be forwarded to the DLL. If not present or an empty string, the value might be derived from the state of the communication, e.g. the diagnostic session the ECU is in.
  • keyArray: Key that is created with the customer DLL.
  • maxKeyArraySize: The maximum allowed number of bytes in the keyArray.
  • keyActualSizeOut: Actual used bytes in the keyArray.
  • ecuQualifier: Qualifier of the ECU or target as set in the diagnostic configuration dialog for the respective diagnostic description.

Return Values

At success 0 will be returned, otherwise an error code will be returned.

Example

This example shows schematically the use of diagGenerateKeyFromSeed and the Callback function in a CAPL test module.
Seed & Key DLL / Security Access_Diag_GenerateKeyResultdiagStartGenerateKeyFromSeedTestWaitForGenerateKeyFromSeed