tor  0.4.1.0-alpha-dev
loadkey.h
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
12 #ifndef TOR_LOADKEY_H
13 #define TOR_LOADKEY_H
14 
16 
17 crypto_pk_t *init_key_from_file(const char *fname, int generate,
18  int severity, bool *created_out);
19 
20 #define INIT_ED_KEY_CREATE (1u<<0)
21 #define INIT_ED_KEY_REPLACE (1u<<1)
22 #define INIT_ED_KEY_SPLIT (1u<<2)
23 #define INIT_ED_KEY_MISSING_SECRET_OK (1u<<3)
24 #define INIT_ED_KEY_NEEDCERT (1u<<4)
25 #define INIT_ED_KEY_EXTRA_STRONG (1u<<5)
26 #define INIT_ED_KEY_INCLUDE_SIGNING_KEY_IN_CERT (1u<<6)
27 #define INIT_ED_KEY_OMIT_SECRET (1u<<7)
28 #define INIT_ED_KEY_TRY_ENCRYPTED (1u<<8)
29 #define INIT_ED_KEY_NO_REPAIR (1u<<9)
30 #define INIT_ED_KEY_SUGGEST_KEYGEN (1u<<10)
31 #define INIT_ED_KEY_OFFLINE_SECRET (1u<<11)
32 #define INIT_ED_KEY_EXPLICIT_FNAME (1u<<12)
33 
34 struct tor_cert_st;
35 ed25519_keypair_t *ed_key_init_from_file(const char *fname, uint32_t flags,
36  int severity,
38  time_t now,
39  time_t lifetime,
40  uint8_t cert_type,
41  struct tor_cert_st **cert_out,
42  const or_options_t *options);
44  uint32_t flags,
45  time_t now,
46  time_t lifetime,
47  uint8_t cert_type,
48  struct tor_cert_st **cert_out);
49 
50 int read_encrypted_secret_key(ed25519_secret_key_t *out,
51  const char *fname);
52 int write_encrypted_secret_key(const ed25519_secret_key_t *out,
53  const char *fname);
54 
55 #endif
ed25519_keypair_t * ed_key_init_from_file(const char *fname, uint32_t flags, int severity, const ed25519_keypair_t *signing_key, time_t now, time_t lifetime, uint8_t cert_type, struct tor_cert_st **cert_out, const or_options_t *options)
Definition: loadkey.c:379
uint8_t cert_type
Definition: torcert.h:38
ed25519_public_key_t signing_key
Definition: torcert.h:28
ed25519_keypair_t * ed_key_new(const ed25519_keypair_t *signing_key, uint32_t flags, time_t now, time_t lifetime, uint8_t cert_type, struct tor_cert_st **cert_out)
Definition: loadkey.c:719
crypto_pk_t * init_key_from_file(const char *fname, int generate, int severity, bool *created_out)
Definition: loadkey.c:40
Header for crypto_ed25519.c.