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.
32 * Callers may need to free the passed resources themselves.
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 /** unix socket of a ssh/pgp agent, char* */
50 /** An arbitrary blob of data, chunk_t */
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 /** SSH public key blob (RFC 4253), chunk_t */
62 /** parameters from algorithmIdentifier (ASN.1 blob), chunk_t */
63 BUILD_BLOB_ALGID_PARAMS
,
64 /** key size in bits, as used for key generation, u_int */
66 /** private key to use for signing, private_key_t* */
68 /** certificate used for signing, certificate_t* */
70 /** public key to include, public_key_t* */
72 /** subject for e.g. certificates, identification_t* */
74 /** additional subject names, linked_list_t* containing identification_t* */
75 BUILD_SUBJECT_ALTNAMES
,
76 /** issuer for e.g. certificates, identification_t* */
78 /** additional issuer names, linked_list_t* containing identification_t* */
79 BUILD_ISSUER_ALTNAMES
,
80 /** notBefore, time_t* */
81 BUILD_NOT_BEFORE_TIME
,
82 /** notAfter, time_t* */
84 /** a serial number in binary form, chunk_t */
86 /** digest algorithm to be used for signature, hash_algorithm_t */
88 /** encryption algorithm to use, encryption_algorithm_t */
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, x509_cdp_t* */
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 /** permitted X509 name constraints, linked_list_t* of identification_t* */
103 BUILD_PERMITTED_NAME_CONSTRAINTS
,
104 /** excluded X509 name constraints, linked_list_t* of identification_t* */
105 BUILD_EXCLUDED_NAME_CONSTRAINTS
,
106 /** certificatePolicy OIDs, linked_list_t* of x509_cert_policy_t* */
107 BUILD_CERTIFICATE_POLICIES
,
108 /** policyMapping OIDs, linked_list_t* of x509_policy_mapping_t* */
109 BUILD_POLICY_MAPPINGS
,
110 /** requireExplicitPolicy constraint, int */
111 BUILD_POLICY_REQUIRE_EXPLICIT
,
112 /** inhibitPolicyMapping constraint, int */
113 BUILD_POLICY_INHIBIT_MAPPING
,
114 /** inhibitAnyPolicy constraint, int */
115 BUILD_POLICY_INHIBIT_ANY
,
116 /** enforce an additional X509 flag, x509_flag_t */
118 /** enumerator_t over (chunk_t serial, time_t date, crl_reason_t reason) */
119 BUILD_REVOKED_ENUMERATOR
,
120 /** Base CRL serial for a delta CRL, chunk_t, */
122 /** PKCS#10 challenge password */
124 /** PKCS#7 attribute, int oid, chunk_t with ASN1 type encoded value */
125 BUILD_PKCS7_ATTRIBUTE
,
126 /** friendly name of a PKCS#11 module, null terminated char* */
128 /** slot specifier for a token in a PKCS#11 module, int */
130 /** key ID of a key on a token, chunk_t */
132 /** modulus (n) of a RSA key, chunk_t */
134 /** public exponent (e) of a RSA key, chunk_t */
136 /** private exponent (d) of a RSA key, chunk_t */
138 /** prime 1 (p) of a RSA key (p < q), chunk_t */
140 /** prime 2 (q) of a RSA key (p < q), chunk_t */
142 /** exponent 1 (exp1) of a RSA key, chunk_t */
144 /** exponent 2 (exp1) of a RSA key, chunk_t */
146 /** coefficient (coeff) of a RSA key, chunk_t */
148 /** generate (p) and (q) as safe primes */
150 /** number of private key shares */
152 /** minimum number of participating private key shares */
154 /** end of variable argument builder list */
159 * enum names for build_part_t
161 extern enum_name_t
*builder_part_names
;
163 #endif /** BUILDER_H_ @}*/