2 * Copyright (C) 2011-2012 Juho Vähä-Herttua
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library 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 GNU
12 * Lesser General Public License for more details.
18 typedef struct rsakey_s rsakey_t
;
20 rsakey_t
*rsakey_init(const unsigned char *modulus
, int mod_len
,
21 const unsigned char *pub_exp
, int pub_len
,
22 const unsigned char *priv_exp
, int priv_len
,
23 const unsigned char *p
, int p_len
,
24 const unsigned char *q
, int q_len
,
25 const unsigned char *dP
, int dP_len
,
26 const unsigned char *dQ
, int dQ_len
,
27 const unsigned char *qInv
, int qInv_len
);
28 rsakey_t
*rsakey_init_pem(const char *pemstr
);
30 int rsakey_sign(rsakey_t
*rsakey
, char *dst
, int dstlen
, const char *b64digest
,
31 unsigned char *ipaddr
, int ipaddrlen
,
32 unsigned char *hwaddr
, int hwaddrlen
);
34 int rsakey_decrypt(rsakey_t
*rsakey
, unsigned char *dst
, int dstlen
, const char *b64input
);
35 int rsakey_parseiv(rsakey_t
*rsakey
, unsigned char *dst
, int dstlen
, const char *b64input
);
37 void rsakey_destroy(rsakey_t
*rsakey
);