RSA Security logo

RSA BSAFE Cert-C
API Reference

capiprov.h

Go to the documentation of this file.
00001 /*
00002 ** Copyright (c) 1999-2003, RSA Security Inc.
00003 **
00004 ** This file is used to demonstrate how to interface to an RSA
00005 ** Security licensed development product.  You have a
00006 ** royalty-free right to use, modify, reproduce and distribute this
00007 ** demonstration file (including any modified version), provided that
00008 ** you agree that RSA Security has no warranty, implied or
00009 ** otherwise, or liability for this demonstration file or any modified
00010 ** version.
00011 **
00012 */
00013 
00023 #ifdef WIN32 /* This is used only when it is for Windows */
00024 
00025 #ifndef HEADER_BSAFE_CERTC_CAPIPROV
00026 #define HEADER_BSAFE_CERTC_CAPIPROV 1
00027 
00028 /*****************************************************************************
00029  *****************************************************************************/
00030 
00031 #include "certc.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 /*****************************************************************************
00038   Macros
00039  *****************************************************************************/
00040 
00041 #ifndef _WCHAR_T_DEFINED
00042   typedef unsigned short wchar_t ;
00043 # define _WCHAR_T_DEFINED
00044 #endif
00045 
00046 #ifdef _MSC_VER
00047 # pragma warning ( disable: 344 )
00048 # if defined(UNICODE) || defined(_UNICODE)
00049     typedef const wchar_t * LPCTSTR ;
00050 # else
00051     typedef const char * LPCTSTR ;
00052 # endif
00053 # pragma warning ( default: 344 )
00054 #endif
00055 
00056 #ifndef DWORD
00057 typedef unsigned char   BYTE ;
00058 typedef unsigned short  WORD ;
00059 typedef unsigned long   DWORD ;
00060 #endif
00061 
00062 /*****************************************************************************
00063   Structures
00064  *****************************************************************************/
00065 
00066 /*
00067     The cryptographic service provider names can be one of the following:
00068 
00069     "Security Dynamics Desktop Provider" (RSA Keon Desktop v 5.1)
00070     "RSA Security Desktop Provider"      (RSA Keon Desktop v 5.5 and v 5.6)
00071     "Microsoft Enhanced Cryptographic Provider v1.0"
00072     "Microsoft Base Cryptographic Provider v1.0"
00073     "Microsoft Exchange Cryptographic Provider v1.0"
00074     "Microsoft Base DSS Cryptographic Provider"
00075     "Microsoft Base DSS and Diffie-Hellman Cryptographic Provider"
00076     "Intel Hardware Cryptographic Service Provider"  On Win95 and Win98
00077 
00078     Not all of these CSPs are available on all machines,
00079     and this list is not all-exhaustive.
00080  */
00081 
00082 /*
00083     The cert store names can be one of the following:
00084 
00085     "MY"
00086     "CA"
00087     "ROOT"
00088     "SPC"
00089     "Trust"
00090     "AddressBook"
00091  */
00092 
00154 typedef struct
00155 {
00156     LPCTSTR pCryptoProviderName ;   /* One crypto provider name only */
00157     LPCTSTR pKeyContainerName ;     /* Key container name to be used */
00158     LPCTSTR pCertSystemStoreName ;  /* Default to "MY" */
00159     DWORD   dwProviderType ;        /* Default to PROV_RSA_FULL */
00160     DWORD   dwKeySpec ;             /* AT_SIGNATURE or AT_KEYEXCHANGE,
00161                                        This is used for InsertPrivateKey() */
00162 } MS_CAPI_DB_PARAMS ;
00163 
00164 /*****************************************************************************
00165   Prototypes
00166  *****************************************************************************/
00167 
00168 /* User of this function needs to include "Crypt32.lib" into the linker */
00169 
00243 int
00244 S_InitializeCryptoAPIDB (
00245     CERTC_CTX         pCtx,         /* (in)  Cert-C context */
00246     POINTER           pParams,      /* (in)  Provider-specific parameters */
00247     SERVICE_FUNCS *   pFuncs,       /* (out) Provider functions */
00248     POINTER       *   ppHandle) ;   /* (out) Provider handle */
00249 
00250 /*****************************************************************************
00251  *****************************************************************************/
00252 
00253 #ifdef __cplusplus
00254 }
00255 #endif
00256 
00257 #endif  /* HEADER_BSAFE_CERTC_CAPIPROV */
00258 #endif  /* WIN32 */



RSA BSAFE® Cert-C 2.7 API Reference