Mistake on this page? Email us
pt_crypto_api.h File Reference

API for crypto operations and retrieving certificates and public keys from storage. More...

#include <stdint.h>
#include "pt-client-2/pt_common_api.h"

Go to the source code of this file.

Macros

#define PT_API_VERSION   2
 
#define PT_CRYPTO_API_H_
 

Typedefs

typedef void(* pt_crypto_success_handler) (const connection_id_t connection_id, const uint8_t *data, const size_t size, void *userdata)
 Type definition for a generic success handler returning a single buffer. More...
 
typedef void(* pt_crypto_failure_handler) (const connection_id_t connection_id, int error_code, void *userdata)
 Type definition for a generic failure response handler. More...
 
typedef pt_crypto_success_handler pt_crypto_get_item_success_handler
 Type definition for pt_crypto_get_item_success_handler response success handler.
 
typedef void(* pt_crypto_get_item_failure_handler) (const connection_id_t connection_id, void *userdata)
 Type definition for pt_crypto_get_item_failure_handler response failure handler. More...
 

Functions

pt_status_t pt_crypto_get_certificate (const connection_id_t connection_id, const char *name, pt_crypto_get_item_success_handler success_handler, pt_crypto_get_item_failure_handler failure_handler, void *userdata)
 Retrieve a certificate from secure storage. More...
 
pt_status_t pt_crypto_get_public_key (const connection_id_t connection_id, const char *name, pt_crypto_get_item_success_handler success_handler, pt_crypto_get_item_failure_handler failure_handler, void *userdata)
 Retrieve a public key from secure storage. More...
 
pt_status_t pt_crypto_generate_random (const connection_id_t connection_id, const size_t size, pt_crypto_success_handler success_handler, pt_crypto_failure_handler failure_handler, void *userdata)
 Generate and retrieve a random buffer from Device Management Edge. More...
 
pt_status_t pt_crypto_asymmetric_sign (const connection_id_t connection_id, const char *private_key_name, const char *hash_digest, const size_t hash_digest_size, pt_crypto_success_handler success_handler, pt_crypto_failure_handler failure_handler, void *userdata)
 Perform asymmetric sign operation using given hash digest and private key stored in secure storage on Device Management Edge. More...
 
pt_status_t pt_crypto_asymmetric_verify (const connection_id_t connection_id, const char *public_key_name, const char *hash_digest, const size_t hash_digest_size, const char *signature, const size_t signature_size, pt_crypto_success_handler success_handler, pt_crypto_failure_handler failure_handler, void *userdata)
 Perform asymmetric verify operation on given signature and hash digest using public key stored in secure storage on Device Management Edge. More...
 
pt_status_t pt_crypto_ecdh_key_agreement (const connection_id_t connection_id, const char *private_key_name, const char *peer_public_key, const size_t peer_public_key_size, pt_crypto_success_handler success_handler, pt_crypto_failure_handler failure_handler, void *userdata)
 Perform ECDH key agreement using given peer public key and a private key stored in secure storage on Device Management Edge. More...
 

Detailed Description

API for crypto operations and retrieving certificates and public keys from storage.