CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
KeyFingerprint.h
Go to the documentation of this file.
1#pragma once
2
3#include <stddef.h>
4#include <stdint.h>
5#include <stdbool.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define KEY_FINGERPRINT_WORD_COUNT 5
12#define KEY_FINGERPRINT_MAX_LEN 64
13
14// Generate alchemical fingerprint for ECC key slot (0-31)
15bool key_fingerprint_generate(uint8_t slot, char* buf, size_t len);
16
17// Generate fingerprint from raw public key
18bool key_fingerprint_from_pubkey(const uint8_t* pubkey, size_t pubkey_len,
19 char* buf, size_t len);
20
21// Lookup word for index (0-31)
22const char* key_fingerprint_word(uint8_t index);
23
24#ifdef __cplusplus
25}
26#endif
27
const char * key_fingerprint_word(uint8_t index)
Returns alchemical word for 5-bit index.
bool key_fingerprint_from_pubkey(const uint8_t *pubkey, size_t pubkey_len, char *buf, size_t len)
Generates human-readable fingerprint from public key bytes.
bool key_fingerprint_generate(uint8_t slot, char *buf, size_t len)
Reads public key from secure element slot and generates fingerprint.