Description

Encrypts the data buffer using the AES128 cryptographic algorithm associated with the Feature. Checks the license conditions of the feature.

If the license is limited by the number of launches, this method decrements the value of the launch counter for the license.

If the GRD_NO_COUNTER_DECREMENT flag is set, the method uses a different encryption key and the launch counter is not decreased. 

The encrypting results of the same data with and without the GRD_NO_COUNTER_DECREMENT flag will be different

For data encryption, it is possible to use the iv initialization vector in all modes except GRD_EM_ECB.

Syntax

public unsafe Status Encrypt(byte[] data, 
							 FeatureEncryptMode mode, 
							 byte[] iv)

Parameters

data
Buffer with data for encryption
mode

Encryption mode:

  • GRD_EM_ECB
  • GRD_EM_CBC
  • GRD_EM_ECB | GRD_NO_COUNTER_DECREMENT
  • GRD_EM_CBC | GRD_NO_COUNTER_DECREMENT
iv
Buffer to transmit initialization vector. Can be NULL

Return values

GRD_OK

GRD_INVALID_HANDLE

GRD_INVALID_FEATURE

  • No labels