00001 /* 00002 * This file is part of contentLister. 00003 * 00004 * contentLister is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * contentLister is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00023 #ifndef __ILIAD_SIGN_H__ 00024 #define __ILIAD_SIGN_H__ 00025 00026 /* These are the possible return values of the functions below */ 00027 #define ERR_SUCCESS (0) 00028 #define ERR_INVALID_PARAMETERS (1) 00029 #define ERR_OUT_OF_MEMORY (2) 00030 #define ERR_UNABLE_TO_READ_PRIVATE_KEY (3) 00031 #define ERR_UNABLE_TO_DECRYPT_PRIVATE_KEY (4) 00032 #define ERR_UNABLE_TO_READ_SOURCE_FILE (5) 00033 #define ERR_UNABLE_TO_CREATE_SIGNATURE (6) 00034 #define ERR_UNABLE_TO_WRITE_OUTPUT_FILE (7) 00035 #define ERR_UNABLE_TO_READ_PUBLIC_KEY (8) 00036 #define ERR_UNABLE_TO_READ_INPUT_FILE (9) 00037 #define ERR_UNABLE_TO_READ_SIGNATURE_FILE (10) 00038 #define ERR_UNABLE_TO_SET_INPUT_FILTER (11) 00039 #define ERR_VERIFICATION_FAILED (99) 00040 00041 /* 00042 * Create a SHA1 signature of input_filename and write it to signature_filename. 00043 * Use the iLiad Private Key, sign it with the appropriate passphrase. 00044 */ 00045 int iliad_create_signature(char * input_filename, char * signature_filename); 00046 00047 /* 00048 * Verify the SHA1 signature of input_filename where the signature is read from 00049 * signature_filename. This uses the iLiad public key. 00050 */ 00051 int iliad_verify_signature(char * input_filename, char * signature_filename); 00052 00053 #endif