CmCalculatePioCoreKey
Description
CmCalculatePioCoreKey calculates the Product Item Option Core Key (PIOCK) from the given data.
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
int CMAPIENTRY CmCalculatePioCoreKey(HCMSysEntry hcmse, CMPIOCK *pcmPioCK, CMBYTE* pbPioCK, CMUINT cbPioCK)
Parameter
hcmse contains a handle opened with CmAccess / CmAccess2 (must be an Entry Access).
pcmPioCK contains a
PIOCKstructure containing the needed data for the PIOCK creation.
|
PIOCK (CmCalculatePioCoreKey) stores all data needed for PIOCK calculation. Syntax
Parameter mcmSecureData contains all needed parameters for an encryption (see
mflCtrl specifies the type of the Firm Item. The following flags can be set).
mulFirmCode specifies the Firm Code used for the simulated encryption. mulProductCode specifies the Product Code used for the simulated encryption. mulHiddenDataAccessCode contains the HDAC (Hidden Data Access Code), which is stored in the HiddenData PIO. This value is not used and must be set to 0 (the default value) for other PIO types. mcbExtFirmKey contains the length of the data stored in mabExtFirmKey. This must be one of the following values: 0, 16, 20 or 32. mabExtFirmKey contains a external key for the simulated encryption. This can only be the data of a HiddenData or SecretData of a CmContainer entry with the normal en-/decryption.
|
pbPioCK receives the calculated PIOCK.
cbPioCK contains the length of the pbPioCK buffer.
Return
CmCalculatePioCoreKey returns CM_BLOCK_SIZE (currently 16), if the creation of the PIOCK was successful. If an error occurred, 0 is returned.
Notes
This function is only for Licensor side because a FSB is needed!
Syntax
public bool CmCalculatePioCoreKey(HCMSysEntry hcmse, CmPioCk PioCK, out byte[] abPioCK) |
Parameter
hcmse contains a handle opened with CmAccess / CmAccess2 (must be an Entry Access).
PioCK contains a
CmPioCK class containing the needed data for the PIOCK creation.
|
CmPioCK (CmCalculatePioCoreKey) stores all data needed for PIOCK calculation. Syntax
Parameter SecureData contains all needed parameters for an encryption (see
Ctrl specifies the type of the Firm Item. The following flags can be set:
FirmCode specifies the Firm Code used for the simulated encryption. ProductCode specifies the Product Code used for the simulated encryption. HiddenDataAccessCode contains the HDAC (Hidden Data Access Code), which is stored in the HiddenData PIO. This value is not used and must be set to 0 (the default value) for other PIO types. ExtFirmKeyLen contains the length of the data stored in ExtFirmKey. This must be one of the following values: 0, 16, 20 or 32. ExtFirmKey contains a external key for the simulated encryption. This can only be the data of a HiddenData or SecretData of a CmContainer entry with the normal en-/decryption.
|
abPioCK receives the calculated PIOCK.
Return
CmCalculatePioCoreKey returns true, if the creation of the PIOCK was successful. If an error occurred, false is returned.
Notes
This function is only for Licensor side because a FSB is needed!
Syntax
import cmapi
handle.CmCalculatePioCoreKey(pcmPioCK: cmapi.CMPIOCK) -> bytes
throws CodeMeterApiFailedException()
Parameter
handle is the handle opened with CmAccess2 (must be an Entry Access).
pcmPioCK contains a
cmapi.PIOCKstructure containing the needed data for the PIOCK creation.
|
PIOCK (CmCalculatePioCoreKey) stores all data needed for PIOCK calculation. Syntax
Parameter mcmSecureData contains all needed parameters for an encryption (see
mflCtrl specifies the type of the Firm Item. The following flags can be set).
mulFirmCode specifies the Firm Code used for the simulated encryption. mulProductCode specifies the Product Code used for the simulated encryption. mulHiddenDataAccessCode contains the HDAC (Hidden Data Access Code), which is stored in the HiddenData PIO. This value is not used and must be set to 0 (the default value) for other PIO types. mcbExtFirmKey contains the length of the data stored in mabExtFirmKey. This must be one of the following values: 0, 16, 20 or 32. mabExtFirmKey contains a external key for the simulated encryption. This can only be the data of a HiddenData or SecretData of a CmContainer entry with the normal en-/decryption.
|
Return
CmCalculatePioCoreKey returns the created PIOCK. If an error occurred, an exception is thrown.
This function is only for Licensor side because a FSB is needed!