RSA Security logo

RSA BSAFE Cert-C
API Reference

cmp.h

Go to the documentation of this file.
00001 /*  
00002 ** Copyright (c) 2000-2002, 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 
00020 #ifndef _CMP_H_
00021 #define _CMP_H_
00022 
00023 /*****************************************************************************
00024  *****************************************************************************/
00025 
00026 #include "certc.h"
00027 #include "transprt.h"
00028 #include "crmf.h"
00029 
00030 #ifdef __cplusplus
00031 extern "C"
00032 {
00033 #endif
00034 
00035 /* CMP Message versions */
00036 #define CMP_VERSION_ONE              1
00037 #define CMP_VERSION_TWO              2
00038 #define CMP_VERSION_DEFAULT          CMP_VERSION_TWO      
00039 
00040 /* CMP message types */
00041 #define PKI_CMP_IR                   0
00042 #define PKI_CMP_IP                   1
00043 #define PKI_CMP_CR                   2
00044 #define PKI_CMP_CP                   3
00045 #define PKI_CMP_KUR                  7
00046 #define PKI_CMP_KUP                  8
00047 #define PKI_CMP_RR                  11
00048 #define PKI_CMP_RP                  12
00049 #define PKI_CMP_PKI_CONF            19
00050 #define PKI_CMP_ERROR               23
00051 #define PKI_CMP_CERT_CONF           24
00052 
00053 /* CMP provider profile */
00054 /* Entrust profile is not yet fully tested. Check the support web site for 
00055  * latest development on Entrust CA support. */
00056 #define  PKI_CMP_PROFILE_CERTICOM    1 /* CMP2 */
00057 #define  PKI_CMP_PROFILE_SSH         2 /* CMP2 */
00058 #define  PKI_CMP_PROFILE_KCA6        3 /* CMP2 */
00059 #define  PKI_CMP_PROFILE_CERTICOM_V1 4 /* CMP1 */
00060 #define  PKI_CMP_PROFILE_SSH_V1      5 /* CMP1 */
00061 #define  PKI_CMP_PROFILE_ENTRUST_V1  6 /* CMP1 */ 
00062 #define _PKI_CMP_PROFILE_MAX         6 /* not for application use */
00063 
00077 typedef struct {
00078   unsigned int   profile;            /* one of PKI_CMP_PROFILE_* */
00079   TRANSPORT_INFO transport;
00080 } PKI_CMP_INIT_STRUCT, *P_PKI_CMP_INIT_STRUCT;
00081 
00082 /* Values for PKI_CMP_SP_INIT_PARAMS.initChoice */
00083 #define  PKI_CMP_INIT_METHOD_STRUCT 0
00084 #define _PKI_CMP_INIT_METHOD_MAX    0 /* not for application use */
00085 
00101 typedef struct {
00102   unsigned int          initChoice;  /* one of PKI_CMP_INIT_METHOD_* */
00103   union {
00104     PKI_CMP_INIT_STRUCT initStruct;
00105   } method;
00106   POINTER handle;                    /* handle for S_CMP... functions */
00107 } PKI_CMP_SP_INIT_PARAMS, *P_PKI_CMP_SP_INIT_PARAMS;
00108 
00159 int S_InitializeCMP (
00160   POINTER        ctx,                /* Cert-C context               */
00161   POINTER        params,             /* Provider-specific parameters */
00162   SERVICE_FUNCS *funcs,              /* (out) Provider functions     */
00163   POINTER       *handle);            /* (out) Provider handle        */
00164 
00165 /* Deprecated Struct/API Begin */
00166 #define PKI_CMP_CERT_CONF_ACCEPT        0
00167 #define PKI_CMP_CERT_CONF_REJECT        1
00168 
00189 typedef struct {
00190   unsigned int     certConfStatus;
00191   PKI_STATUS_INFO *statusInfo;
00192 } PKI_CMP_STATUS_INFO;
00193 
00228 int S_CMPCertConfirm(
00229   CERTC_CTX            ctx,          /* (in)  Cert-C context          */
00230   POINTER              handle,       /* (in)  SP-specific data handle */
00231   PKI_MSG_OBJ          request,      /* (in)  response(ir/cr) object  */
00232   PKI_MSG_OBJ          response,     /* (in)  response(ip/cp) object  */
00233   PKI_PROTECT_INFO    *protectInfo,  /* (in)  protection keys & certs */
00234   PKI_CMP_STATUS_INFO *responseInfo, /* (in)  response to the CA      */
00235   PKI_STATUS_INFO     *statusInfo);  /* (out) statusInfo              */
00236 
00258 int S_CMPSetMessageType(
00259   CERTC_CTX   ctx,                   /* (in)  Cert-C context          */
00260   POINTER     handle,                /* (in)  SP-specific data handle */
00261   int         msgType,               /* (in)  message type            */
00262   PKI_MSG_OBJ msgObj);               /* (mod) response(ip/cp) object  */
00263 
00289 int S_CMPGetMessageType(
00290   CERTC_CTX    ctx,                  /* (in)  Cert-C context          */
00291   POINTER      handle,               /* (in)  SP-specific data handle */
00292   PKI_MSG_OBJ  msgObj,               /* (in)  response(ip/cp) object  */
00293   int         *pMsgType);            /* (out) message type            */
00294 /* Deprecated Struct/API End */
00295 
00296 
00297 #ifdef __cplusplus
00298 }
00299 #endif
00300 
00301 
00302 #endif /* _CMP_H_ */



RSA BSAFE® Cert-C 2.7 API Reference