|
SIAP: Secure Infrastructure Access Protocol 1.0.0.0a (A1)
A post-quantum secure user verification system and access control mechanism
|
SIAP Server functions. More...
#include "siap.h"Go to the source code of this file.
Functions | |
| SIAP_EXPORT_API siap_errors | siap_server_authenticate_device (uint8_t *dtok, siap_device_key *dkey, siap_device_tag *dtag, const siap_server_key *skey, const uint8_t *phash) |
| Authenticate a device. This function hashes a passphrase, decrypts a device keys token-tree, gets the next authentication token, generates a server token, and authenticates the device. | |
| SIAP_EXPORT_API bool | siap_server_decrypt_device_key (siap_device_key *dkey, const siap_server_key *skey, const uint8_t *phash) |
| Decrypt a device key. This function decrypts a device keys token-tree. | |
| SIAP_EXPORT_API void | siap_server_encrypt_device_key (siap_device_key *dkey, const siap_server_key *skey, const uint8_t *phash) |
| Encrypt a device key. This function encrypts a device keys token-tree. | |
| SIAP_EXPORT_API bool | siap_server_extract_authentication_token (uint8_t *token, siap_device_key *dkey, const siap_server_key *skey) |
| Extract an authentication token. This function extracts an authentication token and erases it on the tree. | |
| SIAP_EXPORT_API bool | siap_server_generate_authentication_token (uint8_t *token, const siap_device_tag *dtag, const siap_server_key *skey) |
| Generate an authentication token that matches the device tags token index. This function generates an authentication token using the server key and the device tag. | |
| SIAP_EXPORT_API void | siap_server_generate_device_key (siap_device_key *dkey, const siap_server_key *skey, const uint8_t *did) |
| Generate a device key. This function generates a new SIAP device key using the provided server key. It derives the device key from the server key and sets the key identity and expiration time. | |
| SIAP_EXPORT_API void | siap_server_generate_device_tag (siap_device_tag *dtag, const siap_device_key *dkey, const uint8_t *phash) |
| Generate a device tag. This function generates a new SIAP device tag structure. It populates the provided device tag structure with the device key identity array and a hash of the device key.. | |
| SIAP_EXPORT_API bool | siap_server_generate_server_key (siap_server_key *skey, const uint8_t *sid) |
| Generate a server key-set. This function generates a new SIAP server key-set based on the provided master key. It populates the server key structure with a derived server key and sets the key identity and expiration time. | |
| SIAP_EXPORT_API void | siap_server_passphrase_generate (char *passphrase, size_t length) |
| Generate a readable pseudo-random passphrase. | |
| SIAP_EXPORT_API void | siap_server_passphrase_hash_generate (uint8_t *phash, const char *passphrase, size_t passlen) |
| Generate the passphrase hash. | |
| SIAP_EXPORT_API bool | siap_server_passphrase_hash_verify (const uint8_t *phash, const char *passphrase, size_t passlen) |
| Verify a passphrase against the hash. | |
| SIAP_EXPORT_API bool | siap_server_verify_device_tag (siap_device_tag *dtag, const siap_device_key *dkey) |
| Hash the key tree and compare it with the value stored in the device tag. | |
SIAP Server functions.
| SIAP_EXPORT_API siap_errors siap_server_authenticate_device | ( | uint8_t * | dtok, |
| siap_device_key * | dkey, | ||
| siap_device_tag * | dtag, | ||
| const siap_server_key * | skey, | ||
| const uint8_t * | phash ) |
Authenticate a device. This function hashes a passphrase, decrypts a device keys token-tree, gets the next authentication token, generates a server token, and authenticates the device.
| dtok | The pointer to the output device token. |
| dkey | The pointer to the device key. |
| dtag | The pointer to the device tag. |
| skey | [const] The input server derivation key. |
| phash | [const] The user passphrase hash. |
| SIAP_EXPORT_API bool siap_server_decrypt_device_key | ( | siap_device_key * | dkey, |
| const siap_server_key * | skey, | ||
| const uint8_t * | phash ) |
Decrypt a device key. This function decrypts a device keys token-tree.
| dkey | The pointer to the output device key. |
| skey | [const] The input server derivation key. |
| phash | [const] The passphrase hash. |
| SIAP_EXPORT_API void siap_server_encrypt_device_key | ( | siap_device_key * | dkey, |
| const siap_server_key * | skey, | ||
| const uint8_t * | phash ) |
Encrypt a device key. This function encrypts a device keys token-tree.
| dkey | The pointer to the output device key. |
| skey | [const] The input server derivation key. |
| phash | [const] The passphrase hash. |
| SIAP_EXPORT_API bool siap_server_extract_authentication_token | ( | uint8_t * | token, |
| siap_device_key * | dkey, | ||
| const siap_server_key * | skey ) |
Extract an authentication token. This function extracts an authentication token and erases it on the tree.
| token | The output authentication token. |
| dkey | The pointer to the output device key. |
| skey | [const] The input server derivation key. |
| SIAP_EXPORT_API bool siap_server_generate_authentication_token | ( | uint8_t * | token, |
| const siap_device_tag * | dtag, | ||
| const siap_server_key * | skey ) |
Generate an authentication token that matches the device tags token index. This function generates an authentication token using the server key and the device tag.
| token | The output authentication token. |
| dtag | [const] The input device tag. |
| skey | [const] A pointer to the server key structure. |
| SIAP_EXPORT_API void siap_server_generate_device_key | ( | siap_device_key * | dkey, |
| const siap_server_key * | skey, | ||
| const uint8_t * | did ) |
Generate a device key. This function generates a new SIAP device key using the provided server key. It derives the device key from the server key and sets the key identity and expiration time.
| dkey | A pointer to the SIAP device key structure. |
| skey | [const] A pointer to the SIAP server key structure. |
| did | [const] The key identity array. |
| SIAP_EXPORT_API void siap_server_generate_device_tag | ( | siap_device_tag * | dtag, |
| const siap_device_key * | dkey, | ||
| const uint8_t * | phash ) |
Generate a device tag. This function generates a new SIAP device tag structure. It populates the provided device tag structure with the device key identity array and a hash of the device key..
| dtag | A pointer to the SIAP device tag structure. |
| dkey | [const] A pointer to the device key. |
| phash | A pointer to the passphrase hash. |
| SIAP_EXPORT_API bool siap_server_generate_server_key | ( | siap_server_key * | skey, |
| const uint8_t * | sid ) |
Generate a server key-set. This function generates a new SIAP server key-set based on the provided master key. It populates the server key structure with a derived server key and sets the key identity and expiration time.
| skey | A pointer to the SIAP server key structure. |
| sid | [const] The key identity array. |
| SIAP_EXPORT_API void siap_server_passphrase_generate | ( | char * | passphrase, |
| size_t | length ) |
Generate a readable pseudo-random passphrase.
| passphrase | A pointer to the passphrase array. |
| length | The passphrase length. |
| SIAP_EXPORT_API void siap_server_passphrase_hash_generate | ( | uint8_t * | phash, |
| const char * | passphrase, | ||
| size_t | passlen ) |
Generate the passphrase hash.
| phash | A pointer to the passphrase hash. |
| passphrase | [const] A pointer to the passphrase. |
| passlen | The passphrase length. |
| SIAP_EXPORT_API bool siap_server_passphrase_hash_verify | ( | const uint8_t * | phash, |
| const char * | passphrase, | ||
| size_t | passlen ) |
Verify a passphrase against the hash.
| phash | [const] A pointer to the passphrase hash. |
| passphrase | [const] A pointer to the passphrase. |
| passlen | The passphrase length. |
| SIAP_EXPORT_API bool siap_server_verify_device_tag | ( | siap_device_tag * | dtag, |
| const siap_device_key * | dkey ) |
Hash the key tree and compare it with the value stored in the device tag.
| dtag | A pointer to the SIAP device tag structure. |
| dkey | [const] A pointer to the device key. |