cookie CmCreateSequence

Description

CmCreateSequence calculates a signature to program any kind of entry in a CmDongle. All security mechanisms are handled by this function. The needed security library (on Windows: CmSecurityLS32.dll), licensor file (CmLicensor.wbc) and Firm Security Box (FSB) must be available. CmCreateSequence can calculate the security sequences for the following tasks:

•Adding a new Firm Item into a CmDongle.

•Updating an existing Firm Item in a CmDongle.

•Deleting an existing Firm Item from a CmDongle.

•Adding a new Product Item to an existing Firm Item in a CmDongle.

•Updating an existing Product Item in a CmDongle.

•Deleting an existing Product Item from a CmDongle.

•(Un-)Locking a CmDongle.

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

Syntax

int CMAPIENTRY CmCreateSequence(HCMSysEntry hcmse, CMULONG flCtrl, CMCREATEITEM *pcmCreateItem, void *pvCtrl, CMUINT cbCtrl)

Parameter

hcmse contains a handle opened by CmAccess / CmAccess2. The Access Mode must be Entry Access to a FSB Entry for a regular license. The handle is related to a CmLocal or a CmLAN subsystem with a connected Firm Security Box (FSB). If the license is an evaluation license not needing any security mechanisms like a FSB, the access can be Box Access. To update the IFI of a local CmDongle the access can also be Box Access. The access can be performed to the CmDongle to be programmed or updated. A matching entry in the CmLicensor/CmFirm.wbc file has to exist in both cases.

flCtrl contains one of the following commands:

nav_open CM_GF_ADD_FIRMITEM calculates the sequence for adding a Firm Item into a CmDongle. pvCtrl is pointing to a hmtoggle_plus1 CMPROGRAM_ADD_FIRMITEM structure.

nav_open CM_GF_UPDATE_FIRMITEM calculates the sequence for updating a Firm Item in a CmDongle. pvCtrl is pointing to a hmtoggle_plus1 CMPROGRAM_UPDATE_FIRMITEM structure.

nav_open CM_GF_DELETE_FIRMITEM calculates the sequence for deleting a Firm Item from a CmDongle. pvCtrl is pointing to a hmtoggle_plus1 CMPROGRAM_DELETE_FIRMITEM structure.

nav_open CM_GF_ADD_PRODUCTITEM calculates the sequence for adding a Product Item into a CmDongle. pvCtrl is pointing to a hmtoggle_plus1 CMPROGRAM_ADD_PRODUCTITEM structure.

nav_open CM_GF_UPDATE_PRODUCTITEM calculates the sequence for updating a Product Item in a CmDongle. pvCtrl is pointing to a hmtoggle_plus1 CMPROGRAM_UPDATE_PRODUCTITEM structure.

nav_open CM_GF_DELETE_PRODUCTITEM calculates the sequence for deleting a Product Item in a CmDongle. pvCtrl is pointing to a hmtoggle_plus1 CMPROGRAM_DELETE_PRODUCTITEM structure.

nav_open CM_GF_SET_BOXLOCK calculates the sequence for locking or unlocking a complete CmDongle. pvCtrl is pointing to a (see structure hmtoggle_plus1 CMPROGRAM_BOXLOCK structure.

nav_open CM_GF_ADD_ENABLBLOCK calculates the sequence for adding a new Enable Block Item to a Firm Item. pvCtrl is pointing to a hmtoggle_plus1 CMENABLING_WRITEADD structure.

nav_open CM_GF_UPDATE_ENABLEBLOCK calculates the sequence for updating an existing Enable Block Item in a Firm Item. pvCtrl is pointing to a hmtoggle_plus1 CMENABLING_WRITEUPDATE structure.

nav_open CM_GF_DELETE_ENABLEBLOCK calculates the sequence for deleting an existing Enable Block Item from a Firm Item. pvCtrl is pointing to a hmtoggle_plus1 CMENABLING_WRITEDELETE structure.

nav_open CM_GF_ATTACH_ENABLEBLOCK calculates the sequence for attaching an existing Enable Block Item in a Firm Item. pvCtrl is pointing to a hmtoggle_plus1 CMENABLING_WRITEATTACHDETACH structure.

nav_open CM_GF_DETACH_ENABLEBLOCK calculates the sequence for detaching an existing Enable Block Item in a Firm Item. pvCtrl is pointing to a CMENABLING_WRITEATTACHDETACH structure.

pcmCreateItem points to a hmtoggle_plus1 CMCREATEITEM structure containing additional information for sequence calculation. The parameter mulFirmUpdateCounter will contain the updated value after the programming sequence is calculated.

pvCtrl contains a structure depending on the flCtrl flag (see above).

cbCtrl contains the number of bytes of the structure stored in pvCtrl.

Return

The return value contains the length of the calculated sequence stored in pvCtrl. If an error occurred, 0 is returned. If cbCtrl is smaller than the return value, then no data in pvCtrl is set and the error code CMERROR_BUFFER_OVERFLOW is set.

Notes

One or more calls of the function CmCreateProductItemOption have to be issued to build the full sequence to program a Product Item Option using the commands CM_GF_ADD_PRODUCTITEM and CM_GF_UPDATE_PRODUCTITEM. CmCreateSequence is the final call and receives the created sequence.

This function is for Licensor site because a FSB is needed. The only exception is the programming of a User's Product Item in the Implicit Firm Item (IFI). In this case the function can also be used on User site.

Syntax

public byte[] CmCreateSequence(HCMSysEntry hcmse, GlobalProgrammingOption Option, ref CmCreateItem CreateItem, object Ctrl)

 

Parameter

hcmse contains a handle opened by CmAccess / CmAccess2. The Access Mode must be Entry Access to a FSB Entry for a regular license. The handle is related to a CmLocal or a CmLAN subsystem with a connected Firm Security Box (FSB). If the license is an evaluation license not needing any security mechanisms like a FSB, the access can be Box Access. To update the IFI of a local CmDongle the access can also be Box Access. The access can be performed to the CmDongle to be programmed or updated. A matching entry in the CmLicensor/CmFirm.wbc file has to exist in both cases.

Option contains one of the following commands:

nav_open AddFirmItem calculates the sequence for adding a Firm Item into a CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramAddFirmItem class.

nav_open UpdateFirmItem calculates the sequence for updating a Firm Item in a CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramUpdateFirmItem class.

nav_open DeleteFirmItem calculates the sequence for deleting a Firm Item from a CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramDeleteFirmItem class.

nav_open AddProductItem calculates the sequence for adding a Product Item into a CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramAddProductItem class.

nav_open UpdateProductItem calculates the sequence for updating a Product Item in a CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramUpdateProductItem class.

nav_open DeleteProductItem calculates the sequence for deleting a Product Item in a CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramDeleteProductItem class.

nav_open SetBoxControl calculates the sequence for locking or unlocking a complete CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramBoxControl class.

nav_open SetBoxLock calculates the sequence for locking or unlocking a complete CmDongle. Ctrl is pointing to a hmtoggle_plus1 CmProgramBoxLock class.

nav_open SetFirmKey programs a Firm Key into an already programmed FSB entry in a CmDongle. Ctrl is a 32 element byte array. hcmse must be Entry Access.

nav_open SetUserKey tba.

nav_open AddEnableBlock calculates the sequence for adding a new Enable Block Item to a Firm Item. Ctrl is a hmtoggle_plus1 CmEnablingWriteAdd class.

nav_open UpdateEnableBlock calculates the sequence for updating an existing Enable Block Item in a Firm Item. Ctrl is a hmtoggle_plus1 CmEnablingWriteUpdate class.

nav_open DeleteEnableBlock calculates the sequence for deleting an existing Enable Block Item from a Firm Item. Ctrl is a hmtoggle_plus1 CmEnablingWriteDelete class.

nav_open AttachEnableBlock calculates the sequence for attaching an existing Enable Block Item in a Firm Item. Ctrl is a hmtoggle_plus1 CmEnablingWriteAttachDetach class.

nav_open DetachEnableBlock calculates the sequence for detaching an existing Enable Block Item in a Firm Item. Ctrl is a CmEnablingWriteAttachDetach class.

CreateItem points to a hmtoggle_plus1 CmCreateItem class containing additional information for sequence calculation. The parameter FirmUpdateCounter will contain the updated value after the programming sequence is calculated.

Ctrl contains a class depending on the Ctrl flag (see above).

Return

The return value contains calculated sequence stored in Ctrl.

Notes

One or more calls of the function CmCreateProductItemOption have to be issued to build the full sequence to program a Product Item Option using the commands AddProductItem and UpdateProductItem. CmCreateSequence is the final call and receives the created sequence.

This function is for Licensor site because a FSB is needed. The only exception is the programming of a User's Product Item in the Implicit Firm Item (IFI). In this case the function can also be used on User site.

 

Not implemented.