#ifndef __hx509_protos_h__
#define __hx509_protos_h__
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef HX509_LIB
#ifndef HX509_LIB_FUNCTION
#if defined(_WIN32)
#define HX509_LIB_FUNCTION __declspec(dllimport)
#define HX509_LIB_CALL __stdcall
#define HX509_LIB_VARIABLE __declspec(dllimport)
#else
#define HX509_LIB_FUNCTION
#define HX509_LIB_CALL
#define HX509_LIB_VARIABLE
#endif
#endif
#endif
void
hx509_bitstring_print (
const heim_bit_string *,
hx509_vprint_func ,
void *);
int
hx509_ca_sign (
hx509_context ,
hx509_ca_tbs ,
hx509_cert ,
hx509_cert *);
int
hx509_ca_sign_self (
hx509_context ,
hx509_ca_tbs ,
hx509_private_key ,
hx509_cert *);
int
hx509_ca_tbs_add_crl_dp_uri (
hx509_context ,
hx509_ca_tbs ,
const char *,
hx509_name );
int
hx509_ca_tbs_add_eku (
hx509_context ,
hx509_ca_tbs ,
const heim_oid *);
int
hx509_ca_tbs_add_san_hostname (
hx509_context ,
hx509_ca_tbs ,
const char *);
int
hx509_ca_tbs_add_san_jid (
hx509_context ,
hx509_ca_tbs ,
const char *);
int
hx509_ca_tbs_add_san_ms_upn (
hx509_context ,
hx509_ca_tbs ,
const char *);
int
hx509_ca_tbs_add_san_otherName (
hx509_context ,
hx509_ca_tbs ,
const heim_oid *,
const heim_octet_string *);
int
hx509_ca_tbs_add_san_pkinit (
hx509_context ,
hx509_ca_tbs ,
const char *);
int
hx509_ca_tbs_add_san_rfc822name (
hx509_context ,
hx509_ca_tbs ,
const char *);
void
hx509_ca_tbs_free (hx509_ca_tbs *);
int
hx509_ca_tbs_init (
hx509_context ,
hx509_ca_tbs *);
int
hx509_ca_tbs_set_ca (
hx509_context ,
hx509_ca_tbs ,
int );
int
hx509_ca_tbs_set_domaincontroller (
hx509_context ,
hx509_ca_tbs );
int
hx509_ca_tbs_set_notAfter (
hx509_context ,
hx509_ca_tbs ,
time_t );
int
hx509_ca_tbs_set_notAfter_lifetime (
hx509_context ,
hx509_ca_tbs ,
time_t );
int
hx509_ca_tbs_set_notBefore (
hx509_context ,
hx509_ca_tbs ,
time_t );
int
hx509_ca_tbs_set_proxy (
hx509_context ,
hx509_ca_tbs ,
int );
int
hx509_ca_tbs_set_serialnumber (
hx509_context ,
hx509_ca_tbs ,
const heim_integer *);
int
hx509_ca_tbs_set_spki (
hx509_context ,
hx509_ca_tbs ,
const SubjectPublicKeyInfo *);
int
hx509_ca_tbs_set_subject (
hx509_context ,
hx509_ca_tbs ,
hx509_name );
int
hx509_ca_tbs_set_template (
hx509_context ,
hx509_ca_tbs ,
int ,
hx509_cert );
int
hx509_ca_tbs_set_unique (
hx509_context ,
hx509_ca_tbs ,
const heim_bit_string *,
const heim_bit_string *);
int
hx509_ca_tbs_subject_expand (
hx509_context ,
hx509_ca_tbs ,
hx509_env );
const struct units *
hx509_ca_tbs_template_units (void);
int
hx509_cert_binary (
hx509_context ,
hx509_cert ,
heim_octet_string *);
int
hx509_cert_check_eku (
hx509_context ,
hx509_cert ,
const heim_oid *,
int );
int
hx509_cert_cmp (
hx509_cert ,
hx509_cert );
int
hx509_cert_find_subjectAltName_otherName (
hx509_context ,
hx509_cert ,
const heim_oid *,
hx509_octet_string_list *);
void
hx509_cert_free (hx509_cert );
int
hx509_cert_get_SPKI (
hx509_context ,
hx509_cert ,
SubjectPublicKeyInfo *);
int
hx509_cert_get_SPKI_AlgorithmIdentifier (
hx509_context ,
hx509_cert ,
AlgorithmIdentifier *);
hx509_cert_attribute
hx509_cert_get_attribute (
hx509_cert ,
const heim_oid *);
int
hx509_cert_get_base_subject (
hx509_context ,
hx509_cert ,
hx509_name *);
const char *
hx509_cert_get_friendly_name (hx509_cert );
int
hx509_cert_get_issuer (
hx509_cert ,
hx509_name *);
int
hx509_cert_get_issuer_unique_id (
hx509_context ,
hx509_cert ,
heim_bit_string *);
time_t
hx509_cert_get_notAfter (hx509_cert );
time_t
hx509_cert_get_notBefore (hx509_cert );
int
hx509_cert_get_serialnumber (
hx509_cert ,
heim_integer *);
int
hx509_cert_get_subject (
hx509_cert ,
hx509_name *);
int
hx509_cert_get_subject_unique_id (
hx509_context ,
hx509_cert ,
heim_bit_string *);
int
hx509_cert_have_private_key (hx509_cert );
int
hx509_cert_init (
hx509_context ,
const Certificate *,
hx509_cert *);
int
hx509_cert_init_data (
hx509_context ,
const void *,
size_t ,
hx509_cert *);
int
hx509_cert_keyusage_print (
hx509_context ,
hx509_cert ,
char **);
int
hx509_cert_public_encrypt (
hx509_context ,
const heim_octet_string *,
const hx509_cert ,
heim_oid *,
heim_octet_string *);
hx509_cert
hx509_cert_ref (hx509_cert );
int
hx509_cert_set_friendly_name (
hx509_cert ,
const char *);
int
hx509_certs_add (
hx509_context ,
hx509_certs ,
hx509_cert );
int
hx509_certs_append (
hx509_context ,
hx509_certs ,
hx509_lock ,
const char *);
int
hx509_certs_end_seq (
hx509_context ,
hx509_certs ,
hx509_cursor );
int
hx509_certs_filter (
hx509_context ,
hx509_certs ,
const hx509_query *,
hx509_certs *);
int
hx509_certs_find (
hx509_context ,
hx509_certs ,
const hx509_query *,
hx509_cert *);
void
hx509_certs_free (hx509_certs *);
int
hx509_certs_info (
hx509_context ,
hx509_certs ,
int (*)(void *, const char *),
void *);
int
hx509_certs_init (
hx509_context ,
const char *,
int ,
hx509_lock ,
hx509_certs *);
#ifdef __BLOCKS__
int
hx509_certs_iter (
hx509_context ,
hx509_certs ,
int (^func)(hx509_cert));
#endif
int
hx509_certs_iter_f (
hx509_context ,
hx509_certs ,
int (*)(hx509_context, void *, hx509_cert),
void *);
int
hx509_certs_merge (
hx509_context ,
hx509_certs ,
hx509_certs );
int
hx509_certs_next_cert (
hx509_context ,
hx509_certs ,
hx509_cursor ,
hx509_cert *);
hx509_certs
hx509_certs_ref (hx509_certs );
int
hx509_certs_start_seq (
hx509_context ,
hx509_certs ,
hx509_cursor *);
int
hx509_certs_store (
hx509_context ,
hx509_certs ,
int ,
hx509_lock );
int
hx509_ci_print_names (
hx509_context ,
void *,
hx509_cert );
void
hx509_clear_error_string (hx509_context );
int
hx509_cms_create_signed (
hx509_context ,
int ,
const heim_oid *,
const void *,
size_t ,
const AlgorithmIdentifier *,
hx509_certs ,
hx509_peer_info ,
hx509_certs ,
hx509_certs ,
heim_octet_string *);
int
hx509_cms_create_signed_1 (
hx509_context ,
int ,
const heim_oid *,
const void *,
size_t ,
const AlgorithmIdentifier *,
hx509_cert ,
hx509_peer_info ,
hx509_certs ,
hx509_certs ,
heim_octet_string *);
int
hx509_cms_decrypt_encrypted (
hx509_context ,
hx509_lock ,
const void *,
size_t ,
heim_oid *,
heim_octet_string *);
int
hx509_cms_envelope_1 (
hx509_context ,
int ,
hx509_cert ,
const void *,
size_t ,
const heim_oid *,
const heim_oid *,
heim_octet_string *);
int
hx509_cms_unenvelope (
hx509_context ,
hx509_certs ,
int ,
const void *,
size_t ,
const heim_octet_string *,
time_t ,
heim_oid *,
heim_octet_string *);
int
hx509_cms_unwrap_ContentInfo (
const heim_octet_string *,
heim_oid *,
heim_octet_string *,
int *);
int
hx509_cms_wrap_ContentInfo (
const heim_oid *,
const heim_octet_string *,
heim_octet_string *);
void
hx509_context_free (hx509_context *);
int
hx509_context_init (hx509_context *);
void
hx509_context_set_missing_revoke (
hx509_context ,
int );
int
hx509_crl_add_revoked_certs (
hx509_context ,
hx509_crl ,
hx509_certs );
int
hx509_crl_alloc (
hx509_context ,
hx509_crl *);
void
hx509_crl_free (
hx509_context ,
hx509_crl *);
int
hx509_crl_lifetime (
hx509_context ,
hx509_crl ,
int );
int
hx509_crl_sign (
hx509_context ,
hx509_cert ,
hx509_crl ,
heim_octet_string *);
const AlgorithmIdentifier *
hx509_crypto_aes128_cbc (void);
const AlgorithmIdentifier *
hx509_crypto_aes256_cbc (void);
void
hx509_crypto_allow_weak (hx509_crypto );
int
hx509_crypto_available (
hx509_context ,
int ,
hx509_cert ,
AlgorithmIdentifier **,
unsigned int *);
int
hx509_crypto_decrypt (
hx509_crypto ,
const void *,
const size_t ,
heim_octet_string *,
heim_octet_string *);
const AlgorithmIdentifier *
hx509_crypto_des_rsdi_ede3_cbc (void);
void
hx509_crypto_destroy (hx509_crypto );
int
hx509_crypto_encrypt (
hx509_crypto ,
const void *,
const size_t ,
const heim_octet_string *,
heim_octet_string **);
const heim_oid *
hx509_crypto_enctype_by_name (const char *);
void
hx509_crypto_free_algs (
AlgorithmIdentifier *,
unsigned int );
int
hx509_crypto_get_params (
hx509_context ,
hx509_crypto ,
const heim_octet_string *,
heim_octet_string *);
int
hx509_crypto_init (
hx509_context ,
const char *,
const heim_oid *,
hx509_crypto *);
const char *
hx509_crypto_provider (hx509_crypto );
int
hx509_crypto_random_iv (
hx509_crypto ,
heim_octet_string *);
int
hx509_crypto_select (
const hx509_context ,
int ,
const hx509_private_key ,
hx509_peer_info ,
AlgorithmIdentifier *);
int
hx509_crypto_set_key_data (
hx509_crypto ,
const void *,
size_t );
int
hx509_crypto_set_key_name (
hx509_crypto ,
const char *);
void
hx509_crypto_set_padding (
hx509_crypto ,
int );
int
hx509_crypto_set_params (
hx509_context ,
hx509_crypto ,
const heim_octet_string *,
heim_octet_string *);
int
hx509_crypto_set_random_key (
hx509_crypto ,
heim_octet_string *);
int
hx509_env_add (
hx509_context ,
hx509_env *,
const char *,
const char *);
int
hx509_env_add_binding (
hx509_context ,
hx509_env *,
const char *,
hx509_env );
const char *
hx509_env_find (
hx509_context ,
hx509_env ,
const char *);
hx509_env
hx509_env_find_binding (
hx509_context ,
hx509_env ,
const char *);
void
hx509_env_free (hx509_env *);
const char *
hx509_env_lfind (
hx509_context ,
hx509_env ,
const char *,
size_t );
void
hx509_err (
hx509_context ,
int ,
int ,
const char *,
...);
hx509_private_key_ops *
hx509_find_private_alg (const heim_oid *);
void
hx509_free_error_string (char *);
void
hx509_free_octet_string_list (hx509_octet_string_list *);
int
hx509_general_name_unparse (
GeneralName *,
char **);
char *
hx509_get_error_string (
hx509_context ,
int );
int
hx509_get_one_cert (
hx509_context ,
hx509_certs ,
hx509_cert *);
int
hx509_lock_add_cert (
hx509_context ,
hx509_lock ,
hx509_cert );
int
hx509_lock_add_certs (
hx509_context ,
hx509_lock ,
hx509_certs );
int
hx509_lock_add_password (
hx509_lock ,
const char *);
int
hx509_lock_command_string (
hx509_lock ,
const char *);
void
hx509_lock_free (hx509_lock );
int
hx509_lock_init (
hx509_context ,
hx509_lock *);
int
hx509_lock_prompt (
hx509_lock ,
hx509_prompt *);
void
hx509_lock_reset_certs (
hx509_context ,
hx509_lock );
void
hx509_lock_reset_passwords (hx509_lock );
void
hx509_lock_reset_promper (hx509_lock );
int
hx509_lock_set_prompter (
hx509_lock ,
hx509_prompter_fct ,
void *);
int
hx509_name_binary (
const hx509_name ,
heim_octet_string *);
int
hx509_name_cmp (
hx509_name ,
hx509_name );
int
hx509_name_copy (
hx509_context ,
const hx509_name ,
hx509_name *);
int
hx509_name_expand (
hx509_context ,
hx509_name ,
hx509_env );
void
hx509_name_free (hx509_name *);
int
hx509_name_is_null_p (const hx509_name );
int
hx509_name_normalize (
hx509_context ,
hx509_name );
int
hx509_name_to_Name (
const hx509_name ,
Name *);
int
hx509_name_to_string (
const hx509_name ,
char **);
int
hx509_ocsp_request (
hx509_context ,
hx509_certs ,
hx509_certs ,
hx509_cert ,
const AlgorithmIdentifier *,
heim_octet_string *,
heim_octet_string *);
int
hx509_ocsp_verify (
hx509_context ,
time_t ,
hx509_cert ,
int ,
const void *,
size_t ,
time_t *);
void
hx509_oid_print (
const heim_oid *,
hx509_vprint_func ,
void *);
int
hx509_oid_sprint (
const heim_oid *,
char **);
int
hx509_parse_name (
hx509_context ,
const char *,
hx509_name *);
int
hx509_parse_private_key (
hx509_context ,
const AlgorithmIdentifier *,
const void *,
size_t ,
hx509_key_format_t ,
hx509_private_key *);
int
hx509_peer_info_add_cms_alg (
hx509_context ,
hx509_peer_info ,
const AlgorithmIdentifier *);
int
hx509_peer_info_alloc (
hx509_context ,
hx509_peer_info *);
void
hx509_peer_info_free (hx509_peer_info );
int
hx509_peer_info_set_cert (
hx509_peer_info ,
hx509_cert );
int
hx509_peer_info_set_cms_algs (
hx509_context ,
hx509_peer_info ,
const AlgorithmIdentifier *,
size_t );
int
hx509_pem_add_header (
hx509_pem_header **,
const char *,
const char *);
const char *
hx509_pem_find_header (
const hx509_pem_header *,
const char *);
void
hx509_pem_free_header (hx509_pem_header *);
int
hx509_pem_read (
hx509_context ,
FILE *,
hx509_pem_read_func ,
void *);
int
hx509_pem_write (
hx509_context ,
const char *,
hx509_pem_header *,
FILE *,
const void *,
size_t );
int
hx509_print_cert (
hx509_context ,
hx509_cert ,
FILE *);
void
hx509_print_stdout (
void *,
const char *,
va_list );
int
hx509_private_key2SPKI (
hx509_context ,
hx509_private_key ,
SubjectPublicKeyInfo *);
void
hx509_private_key_assign_rsa (
hx509_private_key ,
void *);
int
hx509_private_key_free (hx509_private_key *);
int
hx509_private_key_init (
hx509_private_key *,
hx509_private_key_ops *,
void *);
int
hx509_private_key_private_decrypt (
hx509_context ,
const heim_octet_string *,
const heim_oid *,
hx509_private_key ,
heim_octet_string *);
int
hx509_prompt_hidden (hx509_prompt_type );
int
hx509_query_alloc (
hx509_context ,
hx509_query **);
void
hx509_query_free (
hx509_context ,
hx509_query *);
int
hx509_query_match_cmp_func (
hx509_query *,
int (*)(hx509_context, hx509_cert, void *),
void *);
int
hx509_query_match_eku (
hx509_query *,
const heim_oid *);
int
hx509_query_match_expr (
hx509_context ,
hx509_query *,
const char *);
int
hx509_query_match_friendly_name (
hx509_query *,
const char *);
int
hx509_query_match_issuer_serial (
hx509_query *,
const Name *,
const heim_integer *);
void
hx509_query_match_option (
hx509_query *,
hx509_query_option );
void
hx509_query_statistic_file (
hx509_context ,
const char *);
void
hx509_query_unparse_stats (
hx509_context ,
int ,
FILE *);
void
hx509_request_free (hx509_request *);
int
hx509_request_get_SubjectPublicKeyInfo (
hx509_context ,
hx509_request ,
SubjectPublicKeyInfo *);
int
hx509_request_get_name (
hx509_context ,
hx509_request ,
hx509_name *);
int
hx509_request_init (
hx509_context ,
hx509_request *);
int
hx509_request_set_SubjectPublicKeyInfo (
hx509_context ,
hx509_request ,
const SubjectPublicKeyInfo *);
int
hx509_request_set_name (
hx509_context ,
hx509_request ,
hx509_name );
int
hx509_revoke_add_crl (
hx509_context ,
hx509_revoke_ctx ,
const char *);
int
hx509_revoke_add_ocsp (
hx509_context ,
hx509_revoke_ctx ,
const char *);
void
hx509_revoke_free (hx509_revoke_ctx *);
int
hx509_revoke_init (
hx509_context ,
hx509_revoke_ctx *);
int
hx509_revoke_ocsp_print (
hx509_context ,
const char *,
FILE *);
int
hx509_revoke_verify (
hx509_context ,
hx509_revoke_ctx ,
hx509_certs ,
time_t ,
hx509_cert ,
hx509_cert );
void
hx509_set_error_string (
hx509_context ,
int ,
int ,
const char *,
...);
void
hx509_set_error_stringv (
hx509_context ,
int ,
int ,
const char *,
va_list );
const AlgorithmIdentifier *
hx509_signature_ecPublicKey (void);
const AlgorithmIdentifier *
hx509_signature_ecdsa_with_sha1 (void);
const AlgorithmIdentifier *
hx509_signature_ecdsa_with_sha256 (void);
const AlgorithmIdentifier *
hx509_signature_md5 (void);
const AlgorithmIdentifier *
hx509_signature_rsa (void);
const AlgorithmIdentifier *
hx509_signature_rsa_pkcs1_x509 (void);
const AlgorithmIdentifier *
hx509_signature_rsa_with_md5 (void);
const AlgorithmIdentifier *
hx509_signature_rsa_with_sha1 (void);
const AlgorithmIdentifier *
hx509_signature_rsa_with_sha256 (void);
const AlgorithmIdentifier *
hx509_signature_rsa_with_sha384 (void);
const AlgorithmIdentifier *
hx509_signature_rsa_with_sha512 (void);
const AlgorithmIdentifier *
hx509_signature_sha1 (void);
const AlgorithmIdentifier *
hx509_signature_sha256 (void);
const AlgorithmIdentifier *
hx509_signature_sha384 (void);
const AlgorithmIdentifier *
hx509_signature_sha512 (void);
int
hx509_unparse_der_name (
const void *,
size_t ,
char **);
int
hx509_validate_cert (
hx509_context ,
hx509_validate_ctx ,
hx509_cert );
void
hx509_validate_ctx_add_flags (
hx509_validate_ctx ,
int );
void
hx509_validate_ctx_free (hx509_validate_ctx );
int
hx509_validate_ctx_init (
hx509_context ,
hx509_validate_ctx *);
void
hx509_validate_ctx_set_print (
hx509_validate_ctx ,
hx509_vprint_func ,
void *);
void
hx509_verify_attach_anchors (
hx509_verify_ctx ,
hx509_certs );
void
hx509_verify_attach_revoke (
hx509_verify_ctx ,
hx509_revoke_ctx );
void
hx509_verify_ctx_f_allow_best_before_signature_algs (
hx509_context ,
int );
void
hx509_verify_ctx_f_allow_default_trustanchors (
hx509_verify_ctx ,
int );
void
hx509_verify_destroy_ctx (hx509_verify_ctx );
int
hx509_verify_hostname (
hx509_context ,
const hx509_cert ,
int ,
hx509_hostname_type ,
const char *,
const struct sockaddr *,
int );
int
hx509_verify_init_ctx (
hx509_context ,
hx509_verify_ctx *);
int
hx509_verify_path (
hx509_context ,
hx509_verify_ctx ,
hx509_cert ,
hx509_certs );
void
hx509_verify_set_max_depth (
hx509_verify_ctx ,
unsigned int );
void
hx509_verify_set_proxy_certificate (
hx509_verify_ctx ,
int );
void
hx509_verify_set_strict_rfc3280_verification (
hx509_verify_ctx ,
int );
void
hx509_verify_set_time (
hx509_verify_ctx ,
time_t );
int
hx509_verify_signature (
hx509_context ,
const hx509_cert ,
const AlgorithmIdentifier *,
const heim_octet_string *,
const heim_octet_string *);
void
hx509_xfree (void *);
int
yywrap (void);
int
hx509_name_from_Name (
const Name *,
hx509_name *);
size_t
hx509_evaluate_get_length(hx509_evaluate data);
hx509_cert
hx509_evaluate_get_cert(hx509_evaluate data, size_t offset);
hx509_cert
hx509_evaluate_get_ta(hx509_evaluate data);
void
hx509_evaluate_free(hx509_evaluate data);
int
hx509_evaluate_cert(hx509_context context,
hx509_verify_ctx ctx,
hx509_cert cert,
hx509_certs pool,
hx509_evaluate *validate);
int
hx509_cert_get_appleid(hx509_context context, hx509_cert cert, char **appleid);
int
hx509_name_get_component(hx509_name name, int rdn, const heim_oid *type, unsigned *count, char **str);
int
hx509_cms_verify_signed(hx509_context context,
hx509_verify_ctx ctx,
unsigned int flags,
const void *data,
size_t length,
const heim_octet_string *signedContent,
hx509_certs pool,
heim_oid *contentType,
heim_octet_string *content,
heim_array_t *signer_evaluate);
int
hx509_cert_init_SecFramework(hx509_context context, void * identity, hx509_cert *cert);
int
hx509_cert_set_persistent(hx509_cert cert, heim_octet_string *persistent);
int
hx509_cert_get_persistent(hx509_cert cert, heim_octet_string *persistent);
int
hx509_query_match_persistent(hx509_query *q, heim_octet_string *ident);
#ifdef __cplusplus
}
#endif
#endif