diff options
| author | Werner Koch <[email protected]> | 2002-01-14 12:15:30 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2002-01-14 12:15:30 +0000 |
| commit | 438b2bcb8cade4875887340387f357fb8594f632 (patch) | |
| tree | eacbb3d18f5e330dc9a5a7876f0d2c2f88940ddb /sm/certlist.c | |
| parent | * assuan-client.c (_assuan_read_from_server): Skip spaces after (diff) | |
| download | gnupg-438b2bcb8cade4875887340387f357fb8594f632.tar.gz gnupg-438b2bcb8cade4875887340387f357fb8594f632.zip | |
* call-dirmngr.c (inq_certificate): Changed for new interface semantic.
* certlist.c (gpgsm_find_cert): New.
DirMngr should now work. Remember that there is a --disable-crl-check
option in gpgsm to be used when there is a problem with the dirmngr
communication or you want to do faster tests.
Diffstat (limited to 'sm/certlist.c')
| -rw-r--r-- | sm/certlist.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sm/certlist.c b/sm/certlist.c index 097f42d14..0035d527c 100644 --- a/sm/certlist.c +++ b/sm/certlist.c @@ -86,3 +86,31 @@ gpgsm_release_certlist (CERTLIST list) } } + +/* Like gpgsm_add_to_certlist, but lookonly for one certificate */ +int +gpgsm_find_cert (const char *name, KsbaCert *r_cert) +{ + int rc; + KEYDB_SEARCH_DESC desc; + KEYDB_HANDLE kh = NULL; + + *r_cert = NULL; + /* fixme: check that we identify excactly one cert with the name */ + rc = keydb_classify_name (name, &desc); + if (!rc) + { + kh = keydb_new (0); + if (!kh) + rc = GNUPG_Out_Of_Core; + else + { + rc = keydb_search (kh, &desc, 1); + if (!rc) + rc = keydb_get_cert (kh, r_cert); + } + } + + keydb_release (kh); + return rc == -1? GNUPG_No_Public_Key: rc; +} |
