Debian Codegraph @

pkcs11/gkm/gkm-rsa-mechanism.h

raw
1 /*
2 * gnome-keyring
3 *
4 * Copyright (C) 2008 Stefan Walter
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
10 *
11 * This program 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 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef GKM_RSA_MECHANISM_H_
22 #define GKM_RSA_MECHANISM_H_
23
24 #include "gkm-crypto.h"
25 #include "gkm-types.h"
26
27 #include "pkcs11/pkcs11.h"
28
29 #include <glib.h>
30
31 #include <gcrypt.h>
32
33 static const CK_MECHANISM_TYPE GKM_RSA_MECHANISMS[] = {
34 CKM_RSA_PKCS,
35 CKM_RSA_X_509
36 };
37
38 CK_RV gkm_rsa_mechanism_encrypt (gcry_sexp_t sexp,
39 EggPadding padding,
40 CK_BYTE_PTR data,
41 CK_ULONG n_data,
42 CK_BYTE_PTR encrypted,
43 CK_ULONG_PTR n_encrypted);
44
45 CK_RV gkm_rsa_mechanism_decrypt (gcry_sexp_t sexp,
46 EggPadding padding,
47 CK_BYTE_PTR encrypted,
48 CK_ULONG n_encrypted,
49 CK_BYTE_PTR data,
50 CK_ULONG_PTR n_data);
51
52 CK_RV gkm_rsa_mechanism_sign (gcry_sexp_t sexp,
53 EggPadding padding,
54 CK_BYTE_PTR data,
55 CK_ULONG n_data,
56 CK_BYTE_PTR signature,
57 CK_ULONG_PTR n_signature);
58
59 CK_RV gkm_rsa_mechanism_verify (gcry_sexp_t sexp,
60 EggPadding padding,
61 CK_BYTE_PTR data,
62 CK_ULONG n_data,
63 CK_BYTE_PTR signature,
64 CK_ULONG n_signature);
65
66 #endif /* GKM_RSA_MECHANISM_H_ */