RSA Security logo

RSA BSAFE Cert-C
API Reference

service.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) RSA Security Inc., 1999-2002.  All rights reserved.
00003 * This work contains proprietary, confidential, and trade secret
00004 * information of RSA Security Inc.  Use, disclosure or reproduction
00005 * without the express written authorization of RSA Security Inc. is
00006 * prohibited.
00007 */
00008 
00009 #ifndef _SERVICE_H_
00010 #define _SERVICE_H_ 1
00011 
00019 #include "basetype.h"
00020 #include "surrspi.h"
00021 #include "logspi.h"
00022 #include "cryptspi.h"
00023 #include "iospi.h"
00024 #include "dbspi.h"
00025 #include "statspi.h"
00026 #include "pathspi.h"
00027 #include "pkispi.h"
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 /* Service provider class types */
00034 #define _SPTCLASS_MIN         0      /* not needed for application use */
00035 #define  SPTCLASS_SURRENDER     0
00036 #define  SPTCLASS_LOG           1
00037 #define  SPTCLASS_CRYPTO        2
00038 #define  SPTCLASS_IO            3
00039 #define  SPTCLASS_DATABASE      4
00040 #define  SPTCLASS_CERT_STATUS   5
00041 #define  SPTCLASS_CERT_PATH     6
00042 #define  SPTCLASS_PKI           7
00043 #define _SPTCLASS_MAX         7      /* not needed for application use */
00044 #define _SPTCLASS_BOGUS      -1      /* not needed for application use */
00045 
00046 /* Service provider types */
00047 #define _SPT_MIN         0
00048 #define  SPT_SURRENDER     0
00049 #define  SPT_LOG           1
00050 #define  SPT_CRYPTO        2
00051 #define  SPT_IO            3
00052 #define  SPT_DATABASE      4
00053 #define  SPT_CERT_STATUS   5
00054 #define  SPT_CERT_PATH     6
00055 #define  SPT_PKI           7
00056 #define  SPT_DATABASE2     8
00057 #define _SPT_MAX         8
00058 
00059 /* Service provider registration orders */
00060 #define SERVICE_ORDER_FIRST  0
00061 #define SERVICE_ORDER_LAST   1
00062 
00102 typedef union {
00103   SURRENDER_FUNCS   surrender;
00104   LOG_FUNCS         log;
00105   CRYPTO_FUNCS      crypto;
00106   IO_FUNCS          io;
00107   DB_FUNCS          db;
00108   CERT_REVOKE_FUNCS revoke;
00109   CERT_PATH_FUNCS   path;
00110   PKI_FUNCS         pki;
00111 } SERVICE_FUNCS;
00112 
00194 typedef struct {
00195   int              type;       /* type of service provider */
00196   char            *name;       /* service provider name    */
00197 
00198   int (*Initialize) (
00199     CERTC_CTX      ctx,        /* Cert-C context               */
00200     POINTER        params,     /* provider-specific parameters */
00201     SERVICE_FUNCS *funcs,      /* (out) provider functions     */
00202     POINTER       *handle);    /* (out) provider handle        */
00203 } SERVICE_HANDLER;
00204 
00245 int C_RegisterService (
00246   CERTC_CTX        ctx,        /* Cert-C context                    */
00247   SERVICE_HANDLER *handler,    /* service handler to register       */
00248   POINTER          params,     /* service initialization parameters */
00249   int              order);     /* first or last                     */
00250 
00314 void C_UnregisterService (
00315   CERTC_CTX  ctx,               /* Cert-C context           */
00316   int        type,              /* service type             */
00317   char      *name);             /* service instance name(s) */
00318 
00386 int C_BindService (
00387   CERTC_CTX  ctx,               /* Cert-C context */
00388   int        type,              /* service type */
00389   char      *name,              /* service instance name(s) */
00390   SERVICE   *service);          /* (out) service pointer */
00391 
00488 int C_BindServices (
00489   CERTC_CTX     ctx,             /* Cert-C context                  */
00490   int           type,            /* service type                    */
00491   char         **names,          /* service instance name(s)        */
00492   unsigned int   nameCount,      /* # of provider names being bound */
00493   SERVICE       *service);       /* (out) service pointer           */
00494 
00514 int C_UnbindService (
00515   SERVICE  *service);    /* service pointer */
00516 
00535 int C_GetProviderNames(
00536   SERVICE           service,
00537   char              **names) ;
00538 
00565 int C_GetProviderCount(
00566   SERVICE           service,
00567   unsigned int      *count);
00568 
00569 #ifdef __cplusplus
00570 }
00571 #endif
00572 
00573 #endif /* _SERVICE_H_ */



RSA BSAFE® Cert-C 2.7 API Reference