cookie CmCryptEcies

Description

CmCryptEcies encrypts a given sequence (up to 32 bytes) with the standard ECIES algorithm. This function is a helper function to use the complete functionality within CodeMeter API.

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

Syntax

int CMAPIENTRY CmCryptEcies(CMBYTE* pbPublicKey, CMUINT cbPublicKey, CMBYTE* pbData, CMUINT cbData)

Parameter

pbPublicKey contains the public key of the other side.

cbPublicKey contains the length of the public key pbPublicKey. Has to be exactly 64 bytes.

pbData is an encryption buffer which contains the data to be encrypted. Its length must be equal to the length of this data plus the length of the public key.

cbData contains the length of pbData.

Return

This function returns the number of en-/decrypted bytes. If an error occurred, 0 will be returned.

Syntax

public bool CmCryptEcies(byte[] PublicKey, byte[] Data)

PublicKey contains the public key of the other side.

Data is an encryption buffer which contains the data to be encrypted. Its length must be equal to the length of this data plus the length of the public key.

Return

This function returns true. If an error occurred, false will be returned.

 

Syntax

import cmapi
 
cmapi.CodeMeter().CmCryptEcies(pbPublicKey: bytes, pbData: bytes)
 -> bytes
throws CodeMeterApiFailedException()

Parameter

pbPublicKey contains the public key of the other side.

pbData is an encryption buffer which contains the data to be encrypted. Its length must be equal to the length of this data plus the length of the public key.

Return

This function returns the en-/decrypted bytes. If an error occurred, an exception is thrown.