routerkeys.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Copyright (c) 2014, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #ifndef TOR_ROUTERKEYS_H
  4. #define TOR_ROUTERKEYS_H
  5. #include "crypto_ed25519.h"
  6. #define INIT_ED_KEY_CREATE (1u<<0)
  7. #define INIT_ED_KEY_REPLACE (1u<<1)
  8. #define INIT_ED_KEY_SPLIT (1u<<2)
  9. #define INIT_ED_KEY_MISSING_SECRET_OK (1u<<3)
  10. #define INIT_ED_KEY_NEEDCERT (1u<<4)
  11. #define INIT_ED_KEY_EXTRA_STRONG (1u<<5)
  12. #define INIT_ED_KEY_INCLUDE_SIGNING_KEY_IN_CERT (1u<<6)
  13. struct tor_cert_st;
  14. ed25519_keypair_t *ed_key_init_from_file(const char *fname, uint32_t flags,
  15. int severity,
  16. const ed25519_keypair_t *signing_key,
  17. time_t now,
  18. time_t lifetime,
  19. uint8_t cert_type,
  20. struct tor_cert_st **cert_out);
  21. ed25519_keypair_t *ed_key_new(const ed25519_keypair_t *signing_key,
  22. uint32_t flags,
  23. time_t now,
  24. time_t lifetime,
  25. uint8_t cert_type,
  26. struct tor_cert_st **cert_out);
  27. const ed25519_public_key_t *get_master_identity_key(void);
  28. const ed25519_keypair_t *get_master_signing_keypair(void);
  29. const struct tor_cert_st *get_master_signing_key_cert(void);
  30. const ed25519_keypair_t *get_current_link_keypair(void);
  31. const ed25519_keypair_t *get_current_auth_keypair(void);
  32. const struct tor_cert_st *get_current_link_key_cert(void);
  33. const struct tor_cert_st *get_current_auth_key_cert(void);
  34. int load_ed_keys(const or_options_t *options, time_t now);
  35. void routerkeys_free_all(void);
  36. #endif