2 Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
3 Ben Kibbey <bjk@luxsci.net>
5 This file is part of pwmd.
7 Pwmd is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 2 of the License, or
10 (at your option) any later version.
12 Pwmd is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with Pwmd. If not, see <http://www.gnu.org/licenses/>.
24 #include <gpg-error.h>
26 #include <sys/types.h>
39 struct crypto_s
*crypto
;
48 assuan_context_t client_ctx
;
50 gpg_error_t (*inquire_cb
) (void *data
, const char *line
);
61 size_t inquire_maxlen
;
64 void cleanup_agent (struct agent_s
*agent
);
65 gpg_error_t
send_to_agent (struct agent_s
*agent
, char **result
, size_t * len
,
66 const char *fmt
, ...);
67 gpg_error_t
agent_init (struct agent_s
**);
68 gpg_error_t
encrypt_data_file (assuan_context_t ctx
, struct crypto_s
*crypto
,
69 gcry_sexp_t pubkey
, gcry_sexp_t sigpkey
,
70 const char *filename
, const void *xml
,
73 gpg_error_t
generate_key (struct crypto_s
*, char *, int, int);
74 gpg_error_t
set_agent_option (struct agent_s
*agent
, const char *name
,
76 gpg_error_t
set_agent_passphrase (struct crypto_s
*crypto
, const char *key
,
78 gpg_error_t
set_pinentry_mode (struct agent_s
*agent
, const char *mode
);
79 gpg_error_t
get_pubkey (struct crypto_s
*crypto
, const char *hexgrip
,
80 gcry_sexp_t
* result
);
81 gpg_error_t
get_pubkey_bin (struct crypto_s
*crypto
,
82 const unsigned char *grip
, gcry_sexp_t
* result
);
83 gpg_error_t
agent_set_pinentry_options (struct agent_s
*agent
);
84 gpg_error_t
agent_export_common (struct crypto_s
*crypto
, const char *keygrip
,
85 const char *sign_keygrip
, int no_passphrase
,
86 const void *data
, size_t datalen
,
87 const char *outfile
, const char *keyparams
,
89 char *default_key_params (struct crypto_s
*crypto
);
90 gpg_error_t
agent_loopback_cb (void *user
, const char *keyword
);
91 gpg_error_t
agent_passwd (struct crypto_s
*crypto
);
92 gpg_error_t
kill_scd (struct agent_s
*);
93 gpg_error_t
agent_extract_key (struct crypto_s
*crypto
, unsigned char **result
,
95 gpg_error_t
agent_verify (gcry_sexp_t pkey
, gcry_sexp_t sig_sexp
,
96 const void *data
, size_t len
);
97 gpg_error_t
send_agent_common_options (struct agent_s
*agent
);