opensc
NPCI secure-component & UPI Lite / Lite X wallet reimplementation
Loading...
Searching...
No Matches
vault.h File Reference

The NPCICLVAULT codec: an AES-GCM-encrypted JSON doc, separately signed, with tamper-reset. More...

#include <stddef.h>
#include "lite/env.h"
Include dependency graph for vault.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  { LITE_OK = 0 , LITE_ERR = -1 , LITE_ERR_ABSENT = -2 , LITE_ERR_TAMPER = -3 }
 Shared return codes for the vault/wallet layer. More...
 

Functions

int lite_vault_open (lite_env *env, const char *alias)
 Ensures the vault's AES and signing keys exist and a valid encrypted record is stored.
 
int lite_vault_reset (lite_env *env, const char *alias)
 Replaces vault contents with an encrypted "{}" under freshly generated keys.
 
long lite_vault_get (lite_env *env, const char *alias, const char *key, char *out, size_t cap)
 Reads one top-level string field into out. Returns length, LITE_ERR_ABSENT, or LITE_ERR_TAMPER.
 
int lite_vault_set (lite_env *env, const char *alias, const char *key, const char *val)
 Read-modify-write of one field. Verifies the current record first; resets on tamper. 0 on success.
 

Detailed Description

The NPCICLVAULT codec: an AES-GCM-encrypted JSON doc, separately signed, with tamper-reset.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Shared return codes for the vault/wallet layer.

Enumerator
LITE_OK 

Success.

LITE_ERR 

Generic failure.

LITE_ERR_ABSENT 

Requested field/record not present.

LITE_ERR_TAMPER 

Signature invalid; the vault was reset as a side effect.