store.h

Go to the documentation of this file.
00001 /* crypto/store/store.h -*- mode:C; c-file-style: "eay" -*- */
00002 /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
00003  * project 2003.
00004  */
00005 /* ====================================================================
00006  * Copyright (c) 2003 The OpenSSL Project.  All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer.
00014  *
00015  * 2. Redistributions in binary form must reproduce the above copyright
00016  *    notice, this list of conditions and the following disclaimer in
00017  *    the documentation and/or other materials provided with the
00018  *    distribution.
00019  *
00020  * 3. All advertising materials mentioning features or use of this
00021  *    software must display the following acknowledgment:
00022  *    "This product includes software developed by the OpenSSL Project
00023  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
00024  *
00025  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
00026  *    endorse or promote products derived from this software without
00027  *    prior written permission. For written permission, please contact
00028  *    openssl-core@openssl.org.
00029  *
00030  * 5. Products derived from this software may not be called "OpenSSL"
00031  *    nor may "OpenSSL" appear in their names without prior written
00032  *    permission of the OpenSSL Project.
00033  *
00034  * 6. Redistributions of any form whatsoever must retain the following
00035  *    acknowledgment:
00036  *    "This product includes software developed by the OpenSSL Project
00037  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
00038  *
00039  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
00040  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00041  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00042  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
00043  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00044  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00045  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00046  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00047  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00048  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00049  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
00050  * OF THE POSSIBILITY OF SUCH DAMAGE.
00051  * ====================================================================
00052  *
00053  * This product includes cryptographic software written by Eric Young
00054  * (eay@cryptsoft.com).  This product includes software written by Tim
00055  * Hudson (tjh@cryptsoft.com).
00056  *
00057  */
00058 
00059 #ifndef HEADER_STORE_H
00060 #define HEADER_STORE_H
00061 
00062 #include <openssl/ossl_typ.h>
00063 #ifndef OPENSSL_NO_DEPRECATED
00064 #include <openssl/evp.h>
00065 #include <openssl/bn.h>
00066 #include <openssl/x509.h>
00067 #endif
00068 
00069 #ifdef  __cplusplus
00070 extern "C" {
00071 #endif
00072 
00073 /* Already defined in ossl_typ.h */
00074 /* typedef struct store_st STORE; */
00075 /* typedef struct store_method_st STORE_METHOD; */
00076 
00077 
00078 /* All the following functions return 0, a negative number or NULL on error.
00079    When everything is fine, they return a positive value or a non-NULL
00080    pointer, all depending on their purpose. */
00081 
00082 /* Creators and destructor.   */
00083 STORE *STORE_new_method(const STORE_METHOD *method);
00084 STORE *STORE_new_engine(ENGINE *engine);
00085 void STORE_free(STORE *ui);
00086 
00087 
00088 /* Give a user interface parametrised control commands.  This can be used to
00089    send down an integer, a data pointer or a function pointer, as well as
00090    be used to get information from a STORE. */
00091 int STORE_ctrl(STORE *store, int cmd, long i, void *p, void (*f)(void));
00092 
00093 /* A control to set the directory with keys and certificates.  Used by the
00094    built-in directory level method. */
00095 #define STORE_CTRL_SET_DIRECTORY 0x0001
00096 /* A control to set a file to load.  Used by the built-in file level method. */
00097 #define STORE_CTRL_SET_FILE      0x0002
00098 /* A control to set a configuration file to load.  Can be used by any method
00099    that wishes to load a configuration file. */
00100 #define STORE_CTRL_SET_CONF_FILE 0x0003
00101 /* A control to set a the section of the loaded configuration file.  Can be
00102    used by any method that wishes to load a configuration file. */
00103 #define STORE_CTRL_SET_CONF_SECTION 0x0004
00104 
00105 
00106 /* Some methods may use extra data */
00107 #define STORE_set_app_data(s,arg)   STORE_set_ex_data(s,0,arg)
00108 #define STORE_get_app_data(s)    STORE_get_ex_data(s,0)
00109 int STORE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
00110    CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
00111 int STORE_set_ex_data(STORE *r,int idx,void *arg);
00112 void *STORE_get_ex_data(STORE *r, int idx);
00113 
00114 /* Use specific methods instead of the built-in one */
00115 const STORE_METHOD *STORE_get_method(STORE *store);
00116 const STORE_METHOD *STORE_set_method(STORE *store, const STORE_METHOD *meth);
00117 
00118 /* The standard OpenSSL methods. */
00119 /* This is the in-memory method.  It does everything except revoking and updating,
00120    and is of course volatile.  It's used by other methods that have an in-memory
00121    cache. */
00122 const STORE_METHOD *STORE_Memory(void);
00123 #if 0 /* Not yet implemented */
00124 /* This is the directory store.  It does everything except revoking and updating,
00125    and uses STORE_Memory() to cache things in memory. */
00126 const STORE_METHOD *STORE_Directory(void);
00127 /* This is the file store.  It does everything except revoking and updating,
00128    and uses STORE_Memory() to cache things in memory.  Certificates are added
00129    to it with the store operation, and it will only get cached certificates. */
00130 const STORE_METHOD *STORE_File(void);
00131 #endif
00132 
00133 /* Store functions take a type code for the type of data they should store
00134    or fetch */
00135 typedef enum STORE_object_types
00136    {
00137    STORE_OBJECT_TYPE_X509_CERTIFICATE= 0x01, /* X509 * */
00138    STORE_OBJECT_TYPE_X509_CRL=      0x02, /* X509_CRL * */
00139    STORE_OBJECT_TYPE_PRIVATE_KEY=      0x03, /* EVP_PKEY * */
00140    STORE_OBJECT_TYPE_PUBLIC_KEY=    0x04, /* EVP_PKEY * */
00141    STORE_OBJECT_TYPE_NUMBER=     0x05, /* BIGNUM * */
00142    STORE_OBJECT_TYPE_ARBITRARY=     0x06, /* BUF_MEM * */
00143    STORE_OBJECT_TYPE_NUM=        0x06  /* The amount of known
00144                       object types */
00145    } STORE_OBJECT_TYPES;
00146 /* List of text strings corresponding to the object types. */
00147 extern const char * const STORE_object_type_string[STORE_OBJECT_TYPE_NUM+1];
00148 
00149 /* Some store functions take a parameter list.  Those parameters come with
00150    one of the following codes. The comments following the codes below indicate
00151    what type the value should be a pointer to. */
00152 typedef enum STORE_params
00153    {
00154    STORE_PARAM_EVP_TYPE=         0x01, /* int */
00155    STORE_PARAM_BITS=       0x02, /* size_t */
00156    STORE_PARAM_KEY_PARAMETERS=      0x03, /* ??? */
00157    STORE_PARAM_KEY_NO_PARAMETERS=      0x04, /* N/A */
00158    STORE_PARAM_AUTH_PASSPHRASE=     0x05, /* char * */
00159    STORE_PARAM_AUTH_KRB5_TICKET=    0x06, /* void * */
00160    STORE_PARAM_TYPE_NUM=         0x06  /* The amount of known
00161                       parameter types */
00162    } STORE_PARAM_TYPES;
00163 /* Parameter value sizes.  -1 means unknown, anything else is the required size. */
00164 extern const int STORE_param_sizes[STORE_PARAM_TYPE_NUM+1];
00165 
00166 /* Store functions take attribute lists.  Those attributes come with codes.
00167    The comments following the codes below indicate what type the value should
00168    be a pointer to. */
00169 typedef enum STORE_attribs
00170    {
00171    STORE_ATTR_END=            0x00,
00172    STORE_ATTR_FRIENDLYNAME=      0x01, /* C string */
00173    STORE_ATTR_KEYID=       0x02, /* 160 bit string (SHA1) */
00174    STORE_ATTR_ISSUERKEYID=       0x03, /* 160 bit string (SHA1) */
00175    STORE_ATTR_SUBJECTKEYID=      0x04, /* 160 bit string (SHA1) */
00176    STORE_ATTR_ISSUERSERIALHASH=     0x05, /* 160 bit string (SHA1) */
00177    STORE_ATTR_ISSUER=         0x06, /* X509_NAME * */
00178    STORE_ATTR_SERIAL=         0x07, /* BIGNUM * */
00179    STORE_ATTR_SUBJECT=        0x08, /* X509_NAME * */
00180    STORE_ATTR_CERTHASH=       0x09, /* 160 bit string (SHA1) */
00181    STORE_ATTR_EMAIL=       0x0a, /* C string */
00182    STORE_ATTR_FILENAME=       0x0b, /* C string */
00183    STORE_ATTR_TYPE_NUM=       0x0b, /* The amount of known
00184                       attribute types */
00185    STORE_ATTR_OR=          0xff  /* This is a special
00186                       separator, which
00187                       expresses the OR
00188                       operation.  */
00189    } STORE_ATTR_TYPES;
00190 /* Attribute value sizes.  -1 means unknown, anything else is the required size. */
00191 extern const int STORE_attr_sizes[STORE_ATTR_TYPE_NUM+1];
00192 
00193 typedef enum STORE_certificate_status
00194    {
00195    STORE_X509_VALID=       0x00,
00196    STORE_X509_EXPIRED=        0x01,
00197    STORE_X509_SUSPENDED=         0x02,
00198    STORE_X509_REVOKED=        0x03
00199    } STORE_CERTIFICATE_STATUS;
00200 
00201 /* Engine store functions will return a structure that contains all the necessary
00202  * information, including revokation status for certificates.  This is really not
00203  * needed for application authors, as the ENGINE framework functions will extract
00204  * the OpenSSL-specific information when at all possible.  However, for engine
00205  * authors, it's crucial to know this structure.  */
00206 typedef struct STORE_OBJECT_st
00207    {
00208    STORE_OBJECT_TYPES type;
00209    union
00210       {
00211       struct
00212          {
00213          STORE_CERTIFICATE_STATUS status;
00214          X509 *certificate;
00215          } x509;
00216       X509_CRL *crl;
00217       EVP_PKEY *key;
00218       BIGNUM *number;
00219       BUF_MEM *arbitrary;
00220       } data;
00221    } STORE_OBJECT;
00222 DECLARE_STACK_OF(STORE_OBJECT)
00223 STORE_OBJECT *STORE_OBJECT_new(void);
00224 void STORE_OBJECT_free(STORE_OBJECT *data);
00225 
00226 
00227 
00228 /* The following functions handle the storage. They return 0, a negative number
00229    or NULL on error, anything else on success. */
00230 X509 *STORE_get_certificate(STORE *e, OPENSSL_ITEM attributes[],
00231    OPENSSL_ITEM parameters[]);
00232 int STORE_store_certificate(STORE *e, X509 *data, OPENSSL_ITEM attributes[],
00233    OPENSSL_ITEM parameters[]);
00234 int STORE_modify_certificate(STORE *e, OPENSSL_ITEM search_attributes[],
00235    OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[],
00236    OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00237 int STORE_revoke_certificate(STORE *e, OPENSSL_ITEM attributes[],
00238    OPENSSL_ITEM parameters[]);
00239 int STORE_delete_certificate(STORE *e, OPENSSL_ITEM attributes[],
00240    OPENSSL_ITEM parameters[]);
00241 void *STORE_list_certificate_start(STORE *e, OPENSSL_ITEM attributes[],
00242    OPENSSL_ITEM parameters[]);
00243 X509 *STORE_list_certificate_next(STORE *e, void *handle);
00244 int STORE_list_certificate_end(STORE *e, void *handle);
00245 int STORE_list_certificate_endp(STORE *e, void *handle);
00246 EVP_PKEY *STORE_generate_key(STORE *e, OPENSSL_ITEM attributes[],
00247    OPENSSL_ITEM parameters[]);
00248 EVP_PKEY *STORE_get_private_key(STORE *e, OPENSSL_ITEM attributes[],
00249    OPENSSL_ITEM parameters[]);
00250 int STORE_store_private_key(STORE *e, EVP_PKEY *data,
00251    OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00252 int STORE_modify_private_key(STORE *e, OPENSSL_ITEM search_attributes[],
00253    OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
00254    OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00255 int STORE_revoke_private_key(STORE *e, OPENSSL_ITEM attributes[],
00256    OPENSSL_ITEM parameters[]);
00257 int STORE_delete_private_key(STORE *e, OPENSSL_ITEM attributes[],
00258    OPENSSL_ITEM parameters[]);
00259 void *STORE_list_private_key_start(STORE *e, OPENSSL_ITEM attributes[],
00260    OPENSSL_ITEM parameters[]);
00261 EVP_PKEY *STORE_list_private_key_next(STORE *e, void *handle);
00262 int STORE_list_private_key_end(STORE *e, void *handle);
00263 int STORE_list_private_key_endp(STORE *e, void *handle);
00264 EVP_PKEY *STORE_get_public_key(STORE *e, OPENSSL_ITEM attributes[],
00265    OPENSSL_ITEM parameters[]);
00266 int STORE_store_public_key(STORE *e, EVP_PKEY *data, OPENSSL_ITEM attributes[],
00267    OPENSSL_ITEM parameters[]);
00268 int STORE_modify_public_key(STORE *e, OPENSSL_ITEM search_attributes[],
00269    OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
00270    OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00271 int STORE_revoke_public_key(STORE *e, OPENSSL_ITEM attributes[],
00272    OPENSSL_ITEM parameters[]);
00273 int STORE_delete_public_key(STORE *e, OPENSSL_ITEM attributes[],
00274    OPENSSL_ITEM parameters[]);
00275 void *STORE_list_public_key_start(STORE *e, OPENSSL_ITEM attributes[],
00276    OPENSSL_ITEM parameters[]);
00277 EVP_PKEY *STORE_list_public_key_next(STORE *e, void *handle);
00278 int STORE_list_public_key_end(STORE *e, void *handle);
00279 int STORE_list_public_key_endp(STORE *e, void *handle);
00280 X509_CRL *STORE_generate_crl(STORE *e, OPENSSL_ITEM attributes[],
00281    OPENSSL_ITEM parameters[]);
00282 X509_CRL *STORE_get_crl(STORE *e, OPENSSL_ITEM attributes[],
00283    OPENSSL_ITEM parameters[]);
00284 int STORE_store_crl(STORE *e, X509_CRL *data, OPENSSL_ITEM attributes[],
00285    OPENSSL_ITEM parameters[]);
00286 int STORE_modify_crl(STORE *e, OPENSSL_ITEM search_attributes[],
00287    OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
00288    OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00289 int STORE_delete_crl(STORE *e, OPENSSL_ITEM attributes[],
00290    OPENSSL_ITEM parameters[]);
00291 void *STORE_list_crl_start(STORE *e, OPENSSL_ITEM attributes[],
00292    OPENSSL_ITEM parameters[]);
00293 X509_CRL *STORE_list_crl_next(STORE *e, void *handle);
00294 int STORE_list_crl_end(STORE *e, void *handle);
00295 int STORE_list_crl_endp(STORE *e, void *handle);
00296 int STORE_store_number(STORE *e, BIGNUM *data, OPENSSL_ITEM attributes[],
00297    OPENSSL_ITEM parameters[]);
00298 int STORE_modify_number(STORE *e, OPENSSL_ITEM search_attributes[],
00299    OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
00300    OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00301 BIGNUM *STORE_get_number(STORE *e, OPENSSL_ITEM attributes[],
00302    OPENSSL_ITEM parameters[]);
00303 int STORE_delete_number(STORE *e, OPENSSL_ITEM attributes[],
00304    OPENSSL_ITEM parameters[]);
00305 int STORE_store_arbitrary(STORE *e, BUF_MEM *data, OPENSSL_ITEM attributes[],
00306    OPENSSL_ITEM parameters[]);
00307 int STORE_modify_arbitrary(STORE *e, OPENSSL_ITEM search_attributes[],
00308    OPENSSL_ITEM add_sttributes[], OPENSSL_ITEM modify_attributes[],
00309    OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00310 BUF_MEM *STORE_get_arbitrary(STORE *e, OPENSSL_ITEM attributes[],
00311    OPENSSL_ITEM parameters[]);
00312 int STORE_delete_arbitrary(STORE *e, OPENSSL_ITEM attributes[],
00313    OPENSSL_ITEM parameters[]);
00314 
00315 
00316 /* Create and manipulate methods */
00317 STORE_METHOD *STORE_create_method(char *name);
00318 void STORE_destroy_method(STORE_METHOD *store_method);
00319 
00320 /* These callback types are use for store handlers */
00321 typedef int (*STORE_INITIALISE_FUNC_PTR)(STORE *);
00322 typedef void (*STORE_CLEANUP_FUNC_PTR)(STORE *);
00323 typedef STORE_OBJECT *(*STORE_GENERATE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00324 typedef STORE_OBJECT *(*STORE_GET_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00325 typedef void *(*STORE_START_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00326 typedef STORE_OBJECT *(*STORE_NEXT_OBJECT_FUNC_PTR)(STORE *, void *handle);
00327 typedef int (*STORE_END_OBJECT_FUNC_PTR)(STORE *, void *handle);
00328 typedef int (*STORE_HANDLE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00329 typedef int (*STORE_STORE_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, STORE_OBJECT *data, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00330 typedef int (*STORE_MODIFY_OBJECT_FUNC_PTR)(STORE *, STORE_OBJECT_TYPES type, OPENSSL_ITEM search_attributes[], OPENSSL_ITEM add_attributes[], OPENSSL_ITEM modify_attributes[], OPENSSL_ITEM delete_attributes[], OPENSSL_ITEM parameters[]);
00331 typedef int (*STORE_GENERIC_FUNC_PTR)(STORE *, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]);
00332 typedef int (*STORE_CTRL_FUNC_PTR)(STORE *, int cmd, long l, void *p, void (*f)(void));
00333 
00334 int STORE_method_set_initialise_function(STORE_METHOD *sm, STORE_INITIALISE_FUNC_PTR init_f);
00335 int STORE_method_set_cleanup_function(STORE_METHOD *sm, STORE_CLEANUP_FUNC_PTR clean_f);
00336 int STORE_method_set_generate_function(STORE_METHOD *sm, STORE_GENERATE_OBJECT_FUNC_PTR generate_f);
00337 int STORE_method_set_get_function(STORE_METHOD *sm, STORE_GET_OBJECT_FUNC_PTR get_f);
00338 int STORE_method_set_store_function(STORE_METHOD *sm, STORE_STORE_OBJECT_FUNC_PTR store_f);
00339 int STORE_method_set_modify_function(STORE_METHOD *sm, STORE_MODIFY_OBJECT_FUNC_PTR store_f);
00340 int STORE_method_set_revoke_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR revoke_f);
00341 int STORE_method_set_delete_function(STORE_METHOD *sm, STORE_HANDLE_OBJECT_FUNC_PTR delete_f);
00342 int STORE_method_set_list_start_function(STORE_METHOD *sm, STORE_START_OBJECT_FUNC_PTR list_start_f);
00343 int STORE_method_set_list_next_function(STORE_METHOD *sm, STORE_NEXT_OBJECT_FUNC_PTR list_next_f);
00344 int STORE_method_set_list_end_function(STORE_METHOD *sm, STORE_END_OBJECT_FUNC_PTR list_end_f);
00345 int STORE_method_set_update_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR);
00346 int STORE_method_set_lock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR);
00347 int STORE_method_set_unlock_store_function(STORE_METHOD *sm, STORE_GENERIC_FUNC_PTR);
00348 int STORE_method_set_ctrl_function(STORE_METHOD *sm, STORE_CTRL_FUNC_PTR ctrl_f);
00349 
00350 STORE_INITIALISE_FUNC_PTR STORE_method_get_initialise_function(STORE_METHOD *sm);
00351 STORE_CLEANUP_FUNC_PTR STORE_method_get_cleanup_function(STORE_METHOD *sm);
00352 STORE_GENERATE_OBJECT_FUNC_PTR STORE_method_get_generate_function(STORE_METHOD *sm);
00353 STORE_GET_OBJECT_FUNC_PTR STORE_method_get_get_function(STORE_METHOD *sm);
00354 STORE_STORE_OBJECT_FUNC_PTR STORE_method_get_store_function(STORE_METHOD *sm);
00355 STORE_MODIFY_OBJECT_FUNC_PTR STORE_method_get_modify_function(STORE_METHOD *sm);
00356 STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_revoke_function(STORE_METHOD *sm);
00357 STORE_HANDLE_OBJECT_FUNC_PTR STORE_method_get_delete_function(STORE_METHOD *sm);
00358 STORE_START_OBJECT_FUNC_PTR STORE_method_get_list_start_function(STORE_METHOD *sm);
00359 STORE_NEXT_OBJECT_FUNC_PTR STORE_method_get_list_next_function(STORE_METHOD *sm);
00360 STORE_END_OBJECT_FUNC_PTR STORE_method_get_list_end_function(STORE_METHOD *sm);
00361 STORE_GENERIC_FUNC_PTR STORE_method_get_update_store_function(STORE_METHOD *sm);
00362 STORE_GENERIC_FUNC_PTR STORE_method_get_lock_store_function(STORE_METHOD *sm);
00363 STORE_GENERIC_FUNC_PTR STORE_method_get_unlock_store_function(STORE_METHOD *sm);
00364 STORE_CTRL_FUNC_PTR STORE_method_get_ctrl_function(STORE_METHOD *sm);
00365 
00366 /* Method helper structures and functions. */
00367 
00368 /* This structure is the result of parsing through the information in a list
00369    of OPENSSL_ITEMs.  It stores all the necessary information in a structured
00370    way.*/
00371 typedef struct STORE_attr_info_st STORE_ATTR_INFO;
00372 
00373 /* Parse a list of OPENSSL_ITEMs and return a pointer to a STORE_ATTR_INFO.
00374    Note that we do this in the list form, since the list of OPENSSL_ITEMs can
00375    come in blocks separated with STORE_ATTR_OR.  Note that the value returned
00376    by STORE_parse_attrs_next() must be freed with STORE_ATTR_INFO_free(). */
00377 void *STORE_parse_attrs_start(OPENSSL_ITEM *attributes);
00378 STORE_ATTR_INFO *STORE_parse_attrs_next(void *handle);
00379 int STORE_parse_attrs_end(void *handle);
00380 int STORE_parse_attrs_endp(void *handle);
00381 
00382 /* Creator and destructor */
00383 STORE_ATTR_INFO *STORE_ATTR_INFO_new(void);
00384 int STORE_ATTR_INFO_free(STORE_ATTR_INFO *attrs);
00385 
00386 /* Manipulators */
00387 char *STORE_ATTR_INFO_get0_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
00388 unsigned char *STORE_ATTR_INFO_get0_sha1str(STORE_ATTR_INFO *attrs,
00389    STORE_ATTR_TYPES code);
00390 X509_NAME *STORE_ATTR_INFO_get0_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
00391 BIGNUM *STORE_ATTR_INFO_get0_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code);
00392 int STORE_ATTR_INFO_set_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00393    char *cstr, size_t cstr_size);
00394 int STORE_ATTR_INFO_set_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00395    unsigned char *sha1str, size_t sha1str_size);
00396 int STORE_ATTR_INFO_set_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00397    X509_NAME *dn);
00398 int STORE_ATTR_INFO_set_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00399    BIGNUM *number);
00400 int STORE_ATTR_INFO_modify_cstr(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00401    char *cstr, size_t cstr_size);
00402 int STORE_ATTR_INFO_modify_sha1str(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00403    unsigned char *sha1str, size_t sha1str_size);
00404 int STORE_ATTR_INFO_modify_dn(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00405    X509_NAME *dn);
00406 int STORE_ATTR_INFO_modify_number(STORE_ATTR_INFO *attrs, STORE_ATTR_TYPES code,
00407    BIGNUM *number);
00408 
00409 /* Compare on basis of a bit pattern formed by the STORE_ATTR_TYPES values
00410    in each contained attribute. */
00411 int STORE_ATTR_INFO_compare(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
00412 /* Check if the set of attributes in a is within the range of attributes
00413    set in b. */
00414 int STORE_ATTR_INFO_in_range(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
00415 /* Check if the set of attributes in a are also set in b. */
00416 int STORE_ATTR_INFO_in(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
00417 /* Same as STORE_ATTR_INFO_in(), but also checks the attribute values. */
00418 int STORE_ATTR_INFO_in_ex(STORE_ATTR_INFO *a, STORE_ATTR_INFO *b);
00419 
00420 
00421 /* BEGIN ERROR CODES */
00422 /* The following lines are auto generated by the script mkerr.pl. Any changes
00423  * made after this point may be overwritten when the script is next run.
00424  */
00425 void ERR_load_STORE_strings(void);
00426 
00427 /* Error codes for the STORE functions. */
00428 
00429 /* Function codes. */
00430 #define STORE_F_MEM_DELETE           134
00431 #define STORE_F_MEM_GENERATE            135
00432 #define STORE_F_MEM_LIST_END            168
00433 #define STORE_F_MEM_LIST_NEXT           136
00434 #define STORE_F_MEM_LIST_START             137
00435 #define STORE_F_MEM_MODIFY           169
00436 #define STORE_F_MEM_STORE            138
00437 #define STORE_F_STORE_ATTR_INFO_GET0_CSTR     139
00438 #define STORE_F_STORE_ATTR_INFO_GET0_DN          140
00439 #define STORE_F_STORE_ATTR_INFO_GET0_NUMBER      141
00440 #define STORE_F_STORE_ATTR_INFO_GET0_SHA1STR     142
00441 #define STORE_F_STORE_ATTR_INFO_MODIFY_CSTR      143
00442 #define STORE_F_STORE_ATTR_INFO_MODIFY_DN     144
00443 #define STORE_F_STORE_ATTR_INFO_MODIFY_NUMBER       145
00444 #define STORE_F_STORE_ATTR_INFO_MODIFY_SHA1STR      146
00445 #define STORE_F_STORE_ATTR_INFO_SET_CSTR      147
00446 #define STORE_F_STORE_ATTR_INFO_SET_DN        148
00447 #define STORE_F_STORE_ATTR_INFO_SET_NUMBER       149
00448 #define STORE_F_STORE_ATTR_INFO_SET_SHA1STR      150
00449 #define STORE_F_STORE_CERTIFICATE          170
00450 #define STORE_F_STORE_CTRL           161
00451 #define STORE_F_STORE_DELETE_ARBITRARY        158
00452 #define STORE_F_STORE_DELETE_CERTIFICATE      102
00453 #define STORE_F_STORE_DELETE_CRL        103
00454 #define STORE_F_STORE_DELETE_NUMBER        104
00455 #define STORE_F_STORE_DELETE_PRIVATE_KEY      105
00456 #define STORE_F_STORE_DELETE_PUBLIC_KEY          106
00457 #define STORE_F_STORE_GENERATE_CRL         107
00458 #define STORE_F_STORE_GENERATE_KEY         108
00459 #define STORE_F_STORE_GET_ARBITRARY        159
00460 #define STORE_F_STORE_GET_CERTIFICATE         109
00461 #define STORE_F_STORE_GET_CRL           110
00462 #define STORE_F_STORE_GET_NUMBER        111
00463 #define STORE_F_STORE_GET_PRIVATE_KEY         112
00464 #define STORE_F_STORE_GET_PUBLIC_KEY          113
00465 #define STORE_F_STORE_LIST_CERTIFICATE_END       114
00466 #define STORE_F_STORE_LIST_CERTIFICATE_ENDP      153
00467 #define STORE_F_STORE_LIST_CERTIFICATE_NEXT      115
00468 #define STORE_F_STORE_LIST_CERTIFICATE_START     116
00469 #define STORE_F_STORE_LIST_CRL_END         117
00470 #define STORE_F_STORE_LIST_CRL_ENDP        154
00471 #define STORE_F_STORE_LIST_CRL_NEXT        118
00472 #define STORE_F_STORE_LIST_CRL_START          119
00473 #define STORE_F_STORE_LIST_PRIVATE_KEY_END       120
00474 #define STORE_F_STORE_LIST_PRIVATE_KEY_ENDP      155
00475 #define STORE_F_STORE_LIST_PRIVATE_KEY_NEXT      121
00476 #define STORE_F_STORE_LIST_PRIVATE_KEY_START     122
00477 #define STORE_F_STORE_LIST_PUBLIC_KEY_END     123
00478 #define STORE_F_STORE_LIST_PUBLIC_KEY_ENDP       156
00479 #define STORE_F_STORE_LIST_PUBLIC_KEY_NEXT       124
00480 #define STORE_F_STORE_LIST_PUBLIC_KEY_START      125
00481 #define STORE_F_STORE_MODIFY_ARBITRARY        162
00482 #define STORE_F_STORE_MODIFY_CERTIFICATE      163
00483 #define STORE_F_STORE_MODIFY_CRL        164
00484 #define STORE_F_STORE_MODIFY_NUMBER        165
00485 #define STORE_F_STORE_MODIFY_PRIVATE_KEY      166
00486 #define STORE_F_STORE_MODIFY_PUBLIC_KEY          167
00487 #define STORE_F_STORE_NEW_ENGINE        133
00488 #define STORE_F_STORE_NEW_METHOD        132
00489 #define STORE_F_STORE_PARSE_ATTRS_END         151
00490 #define STORE_F_STORE_PARSE_ATTRS_ENDP        172
00491 #define STORE_F_STORE_PARSE_ATTRS_NEXT        152
00492 #define STORE_F_STORE_PARSE_ATTRS_START          171
00493 #define STORE_F_STORE_REVOKE_CERTIFICATE      129
00494 #define STORE_F_STORE_REVOKE_PRIVATE_KEY      130
00495 #define STORE_F_STORE_REVOKE_PUBLIC_KEY          131
00496 #define STORE_F_STORE_STORE_ARBITRARY         157
00497 #define STORE_F_STORE_STORE_CERTIFICATE          100
00498 #define STORE_F_STORE_STORE_CRL            101
00499 #define STORE_F_STORE_STORE_NUMBER         126
00500 #define STORE_F_STORE_STORE_PRIVATE_KEY          127
00501 #define STORE_F_STORE_STORE_PUBLIC_KEY        128
00502 
00503 /* Reason codes. */
00504 #define STORE_R_ALREADY_HAS_A_VALUE        127
00505 #define STORE_R_FAILED_DELETING_ARBITRARY     132
00506 #define STORE_R_FAILED_DELETING_CERTIFICATE      100
00507 #define STORE_R_FAILED_DELETING_KEY        101
00508 #define STORE_R_FAILED_DELETING_NUMBER        102
00509 #define STORE_R_FAILED_GENERATING_CRL         103
00510 #define STORE_R_FAILED_GENERATING_KEY         104
00511 #define STORE_R_FAILED_GETTING_ARBITRARY      133
00512 #define STORE_R_FAILED_GETTING_CERTIFICATE       105
00513 #define STORE_R_FAILED_GETTING_KEY         106
00514 #define STORE_R_FAILED_GETTING_NUMBER         107
00515 #define STORE_R_FAILED_LISTING_CERTIFICATES      108
00516 #define STORE_R_FAILED_LISTING_KEYS        109
00517 #define STORE_R_FAILED_MODIFYING_ARBITRARY       138
00518 #define STORE_R_FAILED_MODIFYING_CERTIFICATE     139
00519 #define STORE_R_FAILED_MODIFYING_CRL          140
00520 #define STORE_R_FAILED_MODIFYING_NUMBER          141
00521 #define STORE_R_FAILED_MODIFYING_PRIVATE_KEY     142
00522 #define STORE_R_FAILED_MODIFYING_PUBLIC_KEY      143
00523 #define STORE_R_FAILED_REVOKING_CERTIFICATE      110
00524 #define STORE_R_FAILED_REVOKING_KEY        111
00525 #define STORE_R_FAILED_STORING_ARBITRARY      134
00526 #define STORE_R_FAILED_STORING_CERTIFICATE       112
00527 #define STORE_R_FAILED_STORING_KEY         113
00528 #define STORE_R_FAILED_STORING_NUMBER         114
00529 #define STORE_R_NOT_IMPLEMENTED            128
00530 #define STORE_R_NO_CONTROL_FUNCTION        144
00531 #define STORE_R_NO_DELETE_ARBITRARY_FUNCTION     135
00532 #define STORE_R_NO_DELETE_NUMBER_FUNCTION     115
00533 #define STORE_R_NO_DELETE_OBJECT_FUNCTION     116
00534 #define STORE_R_NO_GENERATE_CRL_FUNCTION      117
00535 #define STORE_R_NO_GENERATE_OBJECT_FUNCTION      118
00536 #define STORE_R_NO_GET_OBJECT_ARBITRARY_FUNCTION    136
00537 #define STORE_R_NO_GET_OBJECT_FUNCTION        119
00538 #define STORE_R_NO_GET_OBJECT_NUMBER_FUNCTION       120
00539 #define STORE_R_NO_LIST_OBJECT_ENDP_FUNCTION     131
00540 #define STORE_R_NO_LIST_OBJECT_END_FUNCTION      121
00541 #define STORE_R_NO_LIST_OBJECT_NEXT_FUNCTION     122
00542 #define STORE_R_NO_LIST_OBJECT_START_FUNCTION       123
00543 #define STORE_R_NO_MODIFY_OBJECT_FUNCTION     145
00544 #define STORE_R_NO_REVOKE_OBJECT_FUNCTION     124
00545 #define STORE_R_NO_STORE             129
00546 #define STORE_R_NO_STORE_OBJECT_ARBITRARY_FUNCTION  137
00547 #define STORE_R_NO_STORE_OBJECT_FUNCTION      125
00548 #define STORE_R_NO_STORE_OBJECT_NUMBER_FUNCTION     126
00549 #define STORE_R_NO_VALUE             130
00550 
00551 #ifdef  __cplusplus
00552 }
00553 #endif
00554 #endif

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6