Skip to main content

SecurityLocalEncryptRsa

Valid for: CANoe DE • CANoe4SW DE

Function Syntax

Description

Encrypts data with a given public key using asymmetric RSA encryption. Padding mode can be selected via the parameter.

Parameters

  • publicKey: The public key to be used for encryption in PKCS#8 format (with VSM 3.4.4 also PKCS#1 format is supported)
  • publicKeyLength: Length of the public key to be used for encryption
  • plainData: Data to be encrypted
  • plainDataLength: Length of the data to be encrypted
  • cipherData [OUT]: Buffer to store encrypted data
  • cipherDataLength [IN/OUT]: Length of buffer to store encrypted data.
  • paddingMode:
    • OAEP(SHA-256) = 1
    • OAEP(SHA-384) = 2
    • OAEP(SHA-512) = 3
    • PKCS1_v1_5 = 10
    • OAEP(SHA-1) = 12

Return Values

  • 1: Success. A value of 1 means that the action was successful.
  • ≤ 0: Error. A value less than or equal to 0 means error.

Example

SecurityLocalDecryptRsaSecurityLocalVerifyRsaSecurityLocalSignRsa