implemented gmp_rsa_public_key.encrypt() method
[strongswan.git] / src / scepclient / pkcs10.h
1 /**
2 * @file pkcs10.h
3 * @brief Functions to build PKCS#10 Request's
4 *
5 * Contains functions to build DER encoded pkcs#10 certificate requests
6 */
7
8 /*
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
21 */
22
23 #ifndef _PKCS10_H
24 #define _PKCS10_H
25
26 #include <credentials/keys/private_key.h>
27 #include <credentials/keys/public_key.h>
28
29 #include "../pluto/defs.h"
30 #include "../pluto/x509.h"
31
32 typedef struct pkcs10_struct pkcs10_t;
33
34 /**
35 * @brief type representating a pkcs#10 request.
36 *
37 * A pkcs#10 request contains a distinguished name, an optional
38 * challenge password, a public key and optional subjectAltNames.
39 *
40 * The RSA private key is needed to compute the signature of the given request
41 */
42 struct pkcs10_struct {
43 private_key_t *private_key;
44 public_key_t *public_key;
45 chunk_t request;
46 chunk_t subject;
47 chunk_t challengePassword;
48 generalName_t *subjectAltNames;
49 };
50
51 extern const pkcs10_t empty_pkcs10;
52
53 extern void pkcs10_add_subjectAltName(generalName_t **subjectAltNames,
54 generalNames_t kind, char *value);
55 extern pkcs10_t* pkcs10_build(private_key_t *private, public_key_t *public,
56 chunk_t subject, chunk_t challengePassword,
57 generalName_t *subjectAltNames, int signature_alg);
58 extern void pkcs10_free(pkcs10_t *pkcs10);
59
60 #endif /* _PKCS10_H */