You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.2 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. #pragma once
  2. #include "pEpEngine.h"
  3. typedef enum _PEP_cryptotech {
  4. PEP_crypt_none = 0,
  5. PEP_crypt_OpenPGP,
  6. // PEP_ctypt_PEP,
  7. // PEP_crypt_SMIME,
  8. // PEP_crypt_CMS,
  9. PEP_crypt__count
  10. } PEP_cryptotech;
  11. typedef PEP_STATUS (*decrypt_and_verify_t)(
  12. PEP_SESSION session, const char *ctext, size_t csize,
  13. char **ptext, size_t *psize, stringlist_t **keylist
  14. );
  15. typedef PEP_STATUS (*verify_text_t)(
  16. PEP_SESSION session, const char *text, size_t size,
  17. const char *signature, size_t sig_size, stringlist_t **keylist
  18. );
  19. typedef PEP_STATUS (*encrypt_and_sign_t)(
  20. PEP_SESSION session, const stringlist_t *keylist, const char *ptext,
  21. size_t psize, char **ctext, size_t *csize
  22. );
  23. typedef PEP_STATUS (*delete_keypair_t)(PEP_SESSION session, const char *fpr);
  24. typedef PEP_STATUS (*export_key_t)(
  25. PEP_SESSION session, const char *fpr, char **key_data, size_t *size
  26. );
  27. typedef PEP_STATUS (*find_keys_t)(
  28. PEP_SESSION session, const char *pattern, stringlist_t **keylist
  29. );
  30. typedef PEP_STATUS (*generate_keypair_t)(
  31. PEP_SESSION session, pEp_identity *identity
  32. );
  33. typedef PEP_STATUS (*get_key_rating_t)(
  34. PEP_SESSION session,
  35. const char *fpr,
  36. PEP_comm_type *comm_type
  37. );
  38. typedef PEP_STATUS (*import_key_t)(PEP_SESSION session, const char *key_data, size_t size);
  39. typedef PEP_STATUS (*recv_key_t)(PEP_SESSION session, const char *pattern);
  40. typedef PEP_STATUS (*send_key_t)(PEP_SESSION session, const char *pattern);
  41. typedef struct _PEP_cryptotech_t {
  42. uint8_t id;
  43. // the following are default values; comm_type may vary with key length or b0rken crypto
  44. uint8_t unconfirmed_comm_type;
  45. uint8_t confirmed_comm_type;
  46. decrypt_and_verify_t decrypt_and_verify;
  47. verify_text_t verify_text;
  48. encrypt_and_sign_t encrypt_and_sign;
  49. delete_keypair_t delete_keypair;
  50. export_key_t export_key;
  51. find_keys_t find_keys;
  52. generate_keypair_t generate_keypair;
  53. get_key_rating_t get_key_rating;
  54. import_key_t import_key;
  55. recv_key_t recv_key;
  56. send_key_t send_key;
  57. } PEP_cryptotech_t;
  58. typedef uint64_t cryptotech_mask;
  59. PEP_STATUS init_cryptotech(PEP_SESSION session);
  60. void release_cryptotech(PEP_SESSION session);