2 * Copyright (C) 2008 Martin Willi
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 * @defgroup builder builder
18 * @{ @ingroup credentials
26 typedef enum builder_part_t builder_part_t
;
29 * Constructor function to build credentials.
31 * Any added parts are cloned/refcounted by the builder implementation, a
32 * caller may need to free the passed ressources themself.
34 * @param subtype constructor specific subtype, e.g. a certificate_type_t
35 * @param args list of builder part types, followed by parts, BUILD_END
36 * @return builder specific credential, NULL on error
38 typedef void* (*builder_function_t
)(int subtype
, va_list args
);
43 * Parts to build credentials from.
46 /** path to a file encoded in any format, char* */
48 /** file descriptor to read data, encoded in any format, int */
50 /** unix socket of a ssh/pgp agent, char* */
52 /** DER encoded ASN.1 blob, chunk_t */
54 /** PEM encoded ASN.1/PGP blob, chunk_t */
56 /** OpenPGP key blob, chunk_t */
58 /** DNS public key blob (RFC 4034, RSA specifc RFC 3110), chunk_t */
60 /** passphrase for e.g. PEM decryption, smartcard unlock, chunk_t */
62 /** passphrase callback, chunk_t(*fn)(void *user, int try), void *user.
63 * The callback is invoked until the returned passphrase is accepted, or
64 * a zero-length passphrase is returned. Try starts at 1. */
65 BUILD_PASSPHRASE_CALLBACK
,
66 /** key size in bits, as used for key generation, u_int */
68 /** private key to use for signing, private_key_t* */
70 /** certificate used for signing, certificate_t* */
72 /** public key to include, public_key_t* */
74 /** subject for e.g. certificates, identification_t* */
76 /** additional subject names, linked_list_t* containing identification_t* */
77 BUILD_SUBJECT_ALTNAMES
,
78 /** issuer for e.g. certificates, identification_t* */
80 /** additional issuer names, linked_list_t* containing identification_t* */
81 BUILD_ISSUER_ALTNAMES
,
82 /** notBefore, time_t* */
83 BUILD_NOT_BEFORE_TIME
,
84 /** notAfter, time_t* */
86 /** a serial number in binary form, chunk_t */
88 /** digest algorithm to be used for signature, int */
90 /** a comma-separated list of ietf group attributes, char* */
91 BUILD_IETF_GROUP_ATTR
,
92 /** a ca certificate, certificate_t* */
94 /** a certificate, certificate_t* */
96 /** CRL distribution point URIs, linked_list_t* containing char* */
97 BUILD_CRL_DISTRIBUTION_POINTS
,
98 /** OCSP AuthorityInfoAccess locations, linked_list_t* containing char* */
99 BUILD_OCSP_ACCESS_LOCATIONS
,
100 /** certificate path length constraint */
102 /** enforce an additional X509 flag, x509_flag_t */
104 /** enumerator_t over (chunk_t serial, time_t date, crl_reason_t reason) */
105 BUILD_REVOKED_ENUMERATOR
,
106 /** friendly name of a PKCS#11 module, null terminated char* */
108 /** slot specifier for a token in a PKCS#11 module, int */
110 /** key ID of a key on a token, chunk_t */
112 /** modulus (n) of a RSA key, chunk_t */
114 /** public exponent (e) of a RSA key, chunk_t */
116 /** private exponent (d) of a RSA key, chunk_t */
118 /** prime 1 (p) of a RSA key (p < q), chunk_t */
120 /** prime 2 (q) of a RSA key (p < q), chunk_t */
122 /** exponent 1 (exp1) of a RSA key, chunk_t */
124 /** exponent 2 (exp1) of a RSA key, chunk_t */
126 /** coefficient (coeff) of a RSA key, chunk_t */
128 /** end of variable argument builder list */
133 * enum names for build_part_t
135 extern enum_name_t
*builder_part_names
;
137 #endif /** BUILDER_H_ @}*/