| 1 | /* usersdb.h - PAM authentication via OpenPGP smartcards. |
| 2 | Copyright (C) 2004, 2005, 2008 g10 Code GmbH |
| 3 | |
| 4 | This file is part of Poldi. |
| 5 | |
| 6 | Poldi is free software; you can redistribute it and/or modify it |
| 7 | under the terms of the GNU General Public License as published by |
| 8 | the Free Software Foundation; either version 3 of the License, or |
| 9 | (at your option) any later version. |
| 10 | |
| 11 | Poldi is distributed in the hope that it will be useful, but |
| 12 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | General Public License for more details. |
| 15 | |
| 16 | You should have received a copy of the GNU General Public License |
| 17 | along with this program; if not, see |
| 18 | <http://www.gnu.org/licenses/>. */ |
| 19 | |
| 20 | #ifndef INCLUDED_USERSDB_H |
| 21 | #define INCLUDED_USERSDB_H |
| 22 | |
| 23 | #include <poldi.h> |
| 24 | |
| 25 | /* This functions figures out wether the provided (SERIALNO, USERNAME) |
| 26 | pair is contained in the users database. */ |
| 27 | gpg_error_t usersdb_check (const char *serialno, const char *username); |
| 28 | |
| 29 | /* This function tries to lookup a username by it's serial number; |
| 30 | this is only possible in case the specified serial number SERIALNO |
| 31 | is associated with exactly one username. The username will be |
| 32 | stored in newly allocated memory in *USERNAME. Returns proper |
| 33 | error code. */ |
| 34 | gpg_error_t usersdb_lookup_by_serialno (const char *serialno, char **username); |
| 35 | |
| 36 | /* This function tries to lookup a serial number by it's username; |
| 37 | this is only possible in case the specified username USERNAME is |
| 38 | associated with exactly one serial number. The serial number will |
| 39 | be stored in newly allocated memory in *SERIALNO. Returns proper |
| 40 | error code. */ |
| 41 | gpg_error_t usersdb_lookup_by_username (const char *username, char **serialno); |
| 42 | |
| 43 | #endif /* INCLUDED_USERSDB_H */ |