Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
ledger_pki.h File Reference
#include "buffer.h"
#include "cx.h"
Include dependency graph for ledger_pki.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum check_signature_with_pki_status_e check_signature_with_pki_status_t
 

Enumerations

enum  check_signature_with_pki_status_e {
  CHECK_SIGNATURE_WITH_PKI_SUCCESS = 0 , CHECK_SIGNATURE_WITH_PKI_MISSING_CERTIFICATE = 1 , CHECK_SIGNATURE_WITH_PKI_WRONG_CERTIFICATE_USAGE = 2 , CHECK_SIGNATURE_WITH_PKI_WRONG_CERTIFICATE_CURVE = 3 ,
  CHECK_SIGNATURE_WITH_PKI_WRONG_SIGNATURE = 4
}
 

Functions

check_signature_with_pki_status_t check_signature_with_pki (const buffer_t hash, const uint8_t *expected_key_usage, const cx_curve_t *expected_curve, const buffer_t signature)
 Checks a signature using the PKI certificate.
 

Typedef Documentation

◆ check_signature_with_pki_status_t

Enumeration Type Documentation

◆ check_signature_with_pki_status_e

Enumerator
CHECK_SIGNATURE_WITH_PKI_SUCCESS 
CHECK_SIGNATURE_WITH_PKI_MISSING_CERTIFICATE 
CHECK_SIGNATURE_WITH_PKI_WRONG_CERTIFICATE_USAGE 
CHECK_SIGNATURE_WITH_PKI_WRONG_CERTIFICATE_CURVE 
CHECK_SIGNATURE_WITH_PKI_WRONG_SIGNATURE 

Definition at line 6 of file ledger_pki.h.

Function Documentation

◆ check_signature_with_pki()

check_signature_with_pki_status_t check_signature_with_pki ( const buffer_t  hash,
const uint8_t *  expected_key_usage,
const cx_curve_t *  expected_curve,
const buffer_t  signature 
)

Checks a signature using the PKI certificate.

This function retrieves the PKI certificate information from the OS, verifies that the key usage and curve match the expected values, and then checks the signature against the provided hash.

Parameters
hashBuffer containing the hash to verify.
expected_key_usageExpected key usage value of the loaded certificate or NULL.
expected_curveExpected elliptic curve of the loaded certificate or NULL.
signatureBuffer containing the signature to verify.
Returns
Status of the signature check (see check_signature_with_pki_status_t).

Definition at line 5 of file ledger_pki.c.