corrected a copy-and-paste error
[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 "../pluto/defs.h"
27 #include "../pluto/pkcs1.h"
28 #include "../pluto/x509.h"
29
30 typedef struct pkcs10_struct pkcs10_t;
31
32 /**
33 * @brief type representating a pkcs#10 request.
34 *
35 * A pkcs#10 request contains a distinguished name, an optional
36 * challenge password, a public key and optional subjectAltNames.
37 *
38 * The RSA private key is needed to compute the signature of the given request
39 */
40 struct pkcs10_struct {
41 RSA_private_key_t *private_key;
42 chunk_t request;
43 chunk_t subject;
44 chunk_t challengePassword;
45 generalName_t *subjectAltNames;
46 };
47
48 extern const pkcs10_t empty_pkcs10;
49
50 extern void pkcs10_add_subjectAltName(generalName_t **subjectAltNames
51 , generalNames_t kind, char *value);
52 extern pkcs10_t* pkcs10_build(RSA_private_key_t *key, chunk_t subject
53 , chunk_t challengePassword, generalName_t *subjectAltNames
54 , int signature_alg);
55 extern void pkcs10_free(pkcs10_t *pkcs10);
56
57 #endif /* _PKCS10_H */