57 lines
1.3 KiB
C
57 lines
1.3 KiB
C
#ifndef KEYGEN_HEADERS_SEEN
|
|
//check header file for re-def conflicts
|
|
|
|
#define KEYGEN_HEADERS_SEEN
|
|
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
|
|
#include "mbedtls/config.h"
|
|
|
|
#include "mbedtls/aes.h"
|
|
#include "mbedtls/bignum.h"
|
|
#include "mbedtls/ctr_drbg.h"
|
|
#include "mbedtls/entropy.h"
|
|
#include "mbedtls/ecp.h"
|
|
#include "mbedtls/ecdh.h"
|
|
#include "mbedtls/ecdsa.h"
|
|
#include "mbedtls/hmac_drbg.h"
|
|
#include "mbedtls/hkdf.h"
|
|
#include "mbedtls/md.h"
|
|
#include "mbedtls/pk.h"
|
|
#include "mbedtls/rsa.h"
|
|
#include "mbedtls/sha1.h"
|
|
#include "mbedtls/sha256.h"
|
|
|
|
#include "defines.h"
|
|
|
|
/*
|
|
DIMASTATUS AsymmKeyGen(KeyDrv_context* KD_ctx);
|
|
DIMASTATUS use_dev_random(void *data, unsigned char *output, size_t len, size_t *olen );
|
|
DIMASTATUS seedRNGSource(void *data, unsigned char *output, size_t len);
|
|
*/
|
|
|
|
|
|
//Create Asymmetric device key from CDI key
|
|
|
|
//Create KD contxt, fill in information required for the asymm key derivation
|
|
//call KeyGen with KD ctx
|
|
//export Pub key?
|
|
//export Pub cert?
|
|
//what else can we do? key chains?
|
|
|
|
|
|
|
|
DIMASTATUS AsymmKeyGen(KeyDrv_context * KD_ctx);
|
|
|
|
|
|
//If KD->phrase is IDENTITY, do not write priv key file outside SS. issue warning.
|
|
DIMASTATUS WritePrivKey(KeyDrv_context * KD_ctx, mbedtls_pk_context * key_ctx);
|
|
DIMASTATUS WritePubKey(KeyDrv_context * KD_ctx, mbedtls_pk_context * key_ctx);
|
|
|
|
|
|
|
|
#endif //KEYGEN_HEADERS_SEEN
|