2 * Copyright (C) 2005-2006 Andre Noll <maan@systemlinux.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
19 /** \file crypt.h prototypes for the RSA crypt functions */
21 #include <openssl/pem.h>
22 int para_decrypt_challenge(char *key_file, long unsigned *challenge_nr,
23 unsigned char *buf, int rsa_inlen);
24 int para_encrypt_challenge(RSA* rsa, long unsigned challenge_nr,
25 unsigned char *outbuf);
26 int para_encrypt_buffer(RSA* rsa, unsigned char *inbuf, const unsigned len,
27 unsigned char *outbuf);
28 int para_decrypt_buffer(char *key_file, unsigned char *outbuf, unsigned char *inbuf,
30 int get_rsa_key(char *key_file, RSA **rsa, int private);
32 /** \cond used to distinguish between loading of private/public key */
33 #define LOAD_PUBLIC_KEY 0
34 #define LOAD_PRIVATE_KEY 1