Skip to main content
Open topic with navigation

SecurityLocalSignEcdsa

CAPL Functions » Security » SecurityLocalSignEcdsa Valid for: CANoe DE • CANoe4SW DE

Function Syntax

SecurityLocalSignEcdsa(dword curve, dword hashAlgorithm, dword signatureFormat, byte privateKey[], dword privateKeyLength, byte data[], dword dataLength, byte signature[], dword* signatureLength)

Description

Generates the signature of the data with a given private key using the ECDSA signature algorithm. The curve, hash algorithm and the signature format can be selected via the parameters.

Parameters

  • dword curve: ID of the curve to use.
    • Available curves:
      • brainpool256r1 = 1
      • brainpool384r1 = 2
      • brainpool512r1 = 3
      • secp256r1 = 4
      • secp384r1 = 5
      • secp521r1 = 6
  • dword hashAlgorithm: ID of the hash algorithm to use.
    • Available hash algorithm:
      • SHA-256 = 1
      • SHA-384 = 2
      • SHA-512 = 3
  • dword signatureFormat: ID of the signature format to use.
    • Available signature formats:
      • IEEE1363 = 0
      • DER sequence = 1
  • byte privateKey[]: Private key to be used for signing.
    • The following formats are accepted:
      • raw key bytes
      • DER
      • PEM
  • dword privateKeyLength: Length of private key to be used for signing.
  • byte data[]: Data to be used for signing.
  • dword dataLength: Length of data to be used for signing.
  • byte signature[] [OUT]: Generated signature.
  • dword signatureLength [IN/OUT]: Length of generated signature.

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

SecurityLocalVerifyEd25519