1/* This is a generated file */ 2#ifndef __hx509_private_h__ 3#define __hx509_private_h__ 4 5#include <stdarg.h> 6 7#ifndef HEIMDAL_NORETURN_ATTRIBUTE 8#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 ))) 9#define HEIMDAL_NORETURN_ATTRIBUTE __attribute__((noreturn)) 10#else 11#define HEIMDAL_NORETURN_ATTRIBUTE 12#endif 13#endif 14 15#ifndef HEIMDAL_PRINTF_ATTRIBUTE 16#if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1 ))) 17#define HEIMDAL_PRINTF_ATTRIBUTE(x) __attribute__((format x)) 18#else 19#define HEIMDAL_PRINTF_ATTRIBUTE(x) 20#endif 21#endif 22 23int 24_hx509_AlgorithmIdentifier_cmp ( 25 const AlgorithmIdentifier *p, 26 const AlgorithmIdentifier *q); 27 28int 29_hx509_Certificate_cmp ( 30 const Certificate *p, 31 const Certificate *q); 32 33int 34_hx509_Name_to_string ( 35 const Name *n, 36 char **str); 37 38time_t 39_hx509_Time2time_t (const Time *t); 40 41void 42_hx509_abort ( 43 const char *fmt, 44 ...) HEIMDAL_NORETURN_ATTRIBUTE 45 HEIMDAL_PRINTF_ATTRIBUTE((printf, 1, 2)); 46 47int 48_hx509_calculate_path ( 49 hx509_context context, 50 int flags, 51 time_t time_now, 52 hx509_certs anchors, 53 unsigned int max_depth, 54 hx509_cert cert, 55 hx509_certs pool, 56 hx509_path *path); 57 58int 59_hx509_cert_get_eku ( 60 hx509_context context, 61 hx509_cert cert, 62 ExtKeyUsage *e); 63 64int 65_hx509_cert_get_keyusage ( 66 hx509_context context, 67 hx509_cert c, 68 KeyUsage *ku); 69 70int 71_hx509_cert_get_version (const Certificate *t); 72 73int 74_hx509_cert_is_parent_cmp ( 75 const Certificate *subject, 76 const Certificate *issuer, 77 int allow_self_signed); 78 79int 80_hx509_cert_private_decrypt ( 81 hx509_context context, 82 const heim_octet_string *ciphertext, 83 const heim_oid *encryption_oid, 84 hx509_cert p, 85 heim_octet_string *cleartext); 86 87hx509_private_key 88_hx509_cert_private_key (hx509_cert p); 89 90int 91_hx509_cert_private_key_exportable (hx509_cert p); 92 93int 94_hx509_cert_set_key ( 95 hx509_cert cert, 96 hx509_private_key private_key); 97 98void 99_hx509_cert_set_release ( 100 hx509_cert cert, 101 _hx509_cert_release_func release, 102 void *ctx); 103 104int 105_hx509_cert_to_env ( 106 hx509_context context, 107 hx509_cert cert, 108 hx509_env *env); 109 110int 111_hx509_certs_keys_add ( 112 hx509_context context, 113 hx509_certs certs, 114 hx509_private_key key); 115 116void 117_hx509_certs_keys_free ( 118 hx509_context context, 119 hx509_private_key *keys); 120 121int 122_hx509_certs_keys_get ( 123 hx509_context context, 124 hx509_certs certs, 125 hx509_private_key **keys); 126 127int 128_hx509_check_key_usage ( 129 hx509_context context, 130 hx509_cert cert, 131 unsigned flags, 132 int req_present); 133 134int 135_hx509_collector_alloc ( 136 hx509_context context, 137 hx509_lock lock, 138 struct hx509_collector **collector); 139 140int 141_hx509_collector_certs_add ( 142 hx509_context context, 143 struct hx509_collector *c, 144 hx509_cert cert); 145 146int 147_hx509_collector_collect_certs ( 148 hx509_context context, 149 struct hx509_collector *c, 150 hx509_certs *ret_certs); 151 152int 153_hx509_collector_collect_private_keys ( 154 hx509_context context, 155 struct hx509_collector *c, 156 hx509_private_key **keys); 157 158void 159_hx509_collector_free (struct hx509_collector *c); 160 161hx509_lock 162_hx509_collector_get_lock (struct hx509_collector *c); 163 164int 165_hx509_collector_private_key_add ( 166 hx509_context context, 167 struct hx509_collector *c, 168 const AlgorithmIdentifier *alg, 169 hx509_private_key private_key, 170 const heim_octet_string *key_data, 171 const heim_octet_string *localKeyId); 172 173int 174_hx509_create_signature ( 175 hx509_context context, 176 const hx509_private_key signer, 177 const AlgorithmIdentifier *alg, 178 const heim_octet_string *data, 179 AlgorithmIdentifier *signatureAlgorithm, 180 heim_octet_string *sig); 181 182int 183_hx509_create_signature_bitstring ( 184 hx509_context context, 185 const hx509_private_key signer, 186 const AlgorithmIdentifier *alg, 187 const heim_octet_string *data, 188 AlgorithmIdentifier *signatureAlgorithm, 189 heim_bit_string *sig); 190 191hx509_evaluate 192_hx509_evaluate_alloc (void); 193 194int 195_hx509_expr_eval ( 196 hx509_context context, 197 hx509_env env, 198 struct hx_expr *expr); 199 200void 201_hx509_expr_free (struct hx_expr *expr); 202 203struct hx_expr * 204_hx509_expr_parse (const char *buf); 205 206int 207_hx509_find_extension_subject_key_id ( 208 const Certificate *issuer, 209 SubjectKeyIdentifier *si); 210 211int 212_hx509_generate_private_key ( 213 hx509_context context, 214 struct hx509_generate_private_context *ctx, 215 hx509_private_key *private_key); 216 217int 218_hx509_generate_private_key_bits ( 219 hx509_context context, 220 struct hx509_generate_private_context *ctx, 221 unsigned long bits); 222 223void 224_hx509_generate_private_key_free (struct hx509_generate_private_context **ctx); 225 226int 227_hx509_generate_private_key_init ( 228 hx509_context context, 229 const heim_oid *oid, 230 struct hx509_generate_private_context **ctx); 231 232int 233_hx509_generate_private_key_is_ca ( 234 hx509_context context, 235 struct hx509_generate_private_context *ctx); 236 237Certificate * 238_hx509_get_cert (hx509_cert cert); 239 240BIGNUM * 241_hx509_int2BN (const heim_integer *i); 242 243void 244_hx509_ks_dir_register (hx509_context context); 245 246void 247_hx509_ks_file_register (hx509_context context); 248 249void 250_hx509_ks_keychain_register (hx509_context context); 251 252void 253_hx509_ks_mem_register (hx509_context context); 254 255void 256_hx509_ks_null_register (hx509_context context); 257 258void 259_hx509_ks_pkcs11_register (hx509_context context); 260 261void 262_hx509_ks_pkcs12_register (hx509_context context); 263 264void 265_hx509_ks_register ( 266 hx509_context context, 267 struct hx509_keyset_ops *ops); 268 269int 270_hx509_lock_find_cert ( 271 hx509_lock lock, 272 const hx509_query *q, 273 hx509_cert *c); 274 275const struct _hx509_password * 276_hx509_lock_get_passwords (hx509_lock lock); 277 278hx509_certs 279_hx509_lock_unlock_certs (hx509_lock lock); 280 281int 282_hx509_map_file_os ( 283 const char *fn, 284 heim_octet_string *os); 285 286int 287_hx509_match_keys ( 288 hx509_cert c, 289 hx509_private_key key); 290 291int 292_hx509_name_cmp ( 293 const Name *n1, 294 const Name *n2, 295 int *c); 296 297int 298_hx509_name_ds_cmp ( 299 const DirectoryString *ds1, 300 const DirectoryString *ds2, 301 int *diff); 302 303int 304_hx509_name_modify ( 305 hx509_context context, 306 Name *name, 307 int append, 308 const heim_oid *oid, 309 const char *str); 310 311int 312_hx509_path_append ( 313 hx509_context context, 314 hx509_path *path, 315 hx509_cert cert); 316 317void 318_hx509_path_free (hx509_path *path); 319 320int 321_hx509_pbe_decrypt ( 322 hx509_context context, 323 hx509_lock lock, 324 const AlgorithmIdentifier *ai, 325 const heim_octet_string *econtent, 326 heim_octet_string *content); 327 328int 329_hx509_pbe_encrypt ( 330 hx509_context context, 331 hx509_lock lock, 332 const AlgorithmIdentifier *ai, 333 const heim_octet_string *content, 334 heim_octet_string *econtent); 335 336void 337_hx509_pi_printf ( 338 int (*func)(void *, const char *), 339 void *ctx, 340 const char *fmt, 341 ...) 342 HEIMDAL_PRINTF_ATTRIBUTE((printf, 3, 4)); 343 344int 345_hx509_private_key_export ( 346 hx509_context context, 347 const hx509_private_key key, 348 hx509_key_format_t format, 349 heim_octet_string *data); 350 351int 352_hx509_private_key_exportable (hx509_private_key key); 353 354BIGNUM * 355_hx509_private_key_get_internal ( 356 hx509_context context, 357 hx509_private_key key, 358 const char *type); 359 360int 361_hx509_private_key_oid ( 362 hx509_context context, 363 const hx509_private_key key, 364 heim_oid *data); 365 366hx509_private_key 367_hx509_private_key_ref (hx509_private_key key); 368 369const char * 370_hx509_private_pem_name (hx509_private_key key); 371 372int 373_hx509_public_encrypt ( 374 hx509_context context, 375 const heim_octet_string *cleartext, 376 const Certificate *cert, 377 heim_oid *encryption_oid, 378 heim_octet_string *ciphertext); 379 380void 381_hx509_query_clear (hx509_query *q); 382 383int 384_hx509_query_match_cert ( 385 hx509_context context, 386 const hx509_query *q, 387 hx509_cert cert); 388 389int 390_hx509_request_add_dns_name ( 391 hx509_context context, 392 hx509_request req, 393 const char *hostname); 394 395int 396_hx509_request_add_eku ( 397 hx509_context context, 398 hx509_request req, 399 const heim_oid *oid); 400 401int 402_hx509_request_add_email ( 403 hx509_context context, 404 hx509_request req, 405 const char *email); 406 407int 408_hx509_request_parse ( 409 hx509_context context, 410 const char *path, 411 hx509_request *req); 412 413int 414_hx509_request_print ( 415 hx509_context context, 416 hx509_request req, 417 FILE *f); 418 419int 420_hx509_request_to_pkcs10 ( 421 hx509_context context, 422 const hx509_request req, 423 const hx509_private_key signer, 424 heim_octet_string *request); 425 426hx509_revoke_ctx 427_hx509_revoke_ref (hx509_revoke_ctx ctx); 428 429void 430_hx509_sel_yyerror (const char *s); 431 432int 433_hx509_self_signed_valid ( 434 hx509_context context, 435 const AlgorithmIdentifier *alg); 436 437int 438_hx509_set_cert_attribute ( 439 hx509_context context, 440 hx509_cert cert, 441 const heim_oid *oid, 442 const heim_octet_string *attr); 443 444int 445_hx509_signature_best_before ( 446 hx509_context context, 447 const AlgorithmIdentifier *alg, 448 time_t t); 449 450void 451_hx509_unmap_file_os (heim_octet_string *os); 452 453int 454_hx509_unparse_Name ( 455 const Name *aname, 456 char **str); 457 458time_t 459_hx509_verify_get_time (hx509_verify_ctx ctx); 460 461int 462_hx509_verify_signature ( 463 hx509_context context, 464 const hx509_cert cert, 465 const AlgorithmIdentifier *alg, 466 const heim_octet_string *data, 467 const heim_octet_string *sig); 468 469int 470_hx509_verify_signature_bitstring ( 471 hx509_context context, 472 const hx509_cert signer, 473 const AlgorithmIdentifier *alg, 474 const heim_octet_string *data, 475 const heim_bit_string *sig); 476 477int 478_hx509_write_file ( 479 const char *fn, 480 const void *data, 481 size_t length); 482 483#endif /* __hx509_private_h__ */ 484