RSA Security logo

RSA BSAFE Cert-C
API Reference

bcert.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 _BCERT_H_
00010 #define _BCERT_H_ 1
00011 
00019 #include "certc.h"
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 extern char * CALL_CONV BCERT_VERSION;
00026  
00027 /* Use PKCS10_OBJ */
00028 typedef POINTER CERT_REQUEST_OBJ;
00029 
00030 /* Use PKCS10_FIELDS */
00031 typedef PKCS10_FIELDS CERT_REQUEST_FIELDS;
00032 
00033 /* Use PKCS10_* replacements */
00034 #define CERT_REQUEST_VERSION_1 0
00035 #define CERT_REQUEST_VERSION_2 1 /* not actually supported!! */
00036 #define DEFAULT_CERT_REQUEST_VERSION CERT_REQUEST_VERSION_1
00037 
00038 typedef POINTER APPL_CTX;
00039 
00040 extern unsigned char ET_POLICY_CONSTRAINTS[];
00041 #define ET_POLICY_CONSTRAINTS_LEN 3
00042 
00043 /* Policy Constraints extension.  This extension uses OID {id-ce 34}
00044    which has been deprecated in the X.509 specification.  It was defined
00045    in an interim working document and never made it into the final
00046    standard.
00047 */
00048 typedef struct POLICY_CONSTRAINTS {
00049   unsigned int certPolicyCount;     /* number of certificate policy 
00050                                        in certPolicies */
00051   ITEM *certPolicies;               /* points to an array of 'certPolicyCount' */
00052                                     /* elements, where each element is a policy OID */
00053   int requireExplicitPolicy;        /* number of certs to skip before constraints
00054                                        apply.  To omit, set to NOT_IN_USE   */
00055   int inhibitPolicyMapping;         /* number of certs to skip before constraints
00056                                        apply; to omit, set to NOT_IN_USE */
00057 } POLICY_CONSTRAINTS;
00058 
00060 int C_CreateCertRequestObject (
00061   CERT_REQUEST_OBJ       *certRequestObject);/* (out) cert req obj to be created */
00062 
00064 void C_DestroyCertRequestObject (
00065   CERT_REQUEST_OBJ       *certRequestObject);    /* cert req obj to destroy */
00066 
00068 int C_GetCertRequestFields (
00069   CERT_REQUEST_OBJ       certRequestObject,  /* (in)  cert req obj     */
00070   CERT_REQUEST_FIELDS    *certRequestFields);/* (out) extracted fields */ 
00071 
00073 int C_SetCertRequestFields (
00074   CERT_REQUEST_OBJ       certRequestObject,  /* (mod) cert req obj           */
00075   CERT_REQUEST_FIELDS    *certRequestFields);/* (in)  cert req fields to set */
00076 
00078 int C_GetCertRequestDER (
00079   CERT_REQUEST_OBJ       certRequestObject,
00080   unsigned char          **der,
00081   unsigned int           *derLen); 
00082 
00084 int C_SetCertRequestBER (
00085   CERT_REQUEST_OBJ       certRequestObject,
00086   unsigned char          *ber,
00087   unsigned int           berLen); 
00088 
00090 int C_SignCertRequest (
00091   CERT_REQUEST_OBJ       certRequestObject,
00092   B_KEY_OBJ              subjectPrivateKey,
00093   B_ALGORITHM_OBJ        randomObject,
00094   int                    signatureAlgorithm, 
00095   unsigned char          *digest,
00096   unsigned int           *digestLen,
00097   unsigned int           maxDigestLen,
00098   A_SURRENDER_CTX        *surrenderContext); 
00099 
00101 int C_VerifyCertRequestSignature (
00102   CERT_REQUEST_OBJ       certRequestObject,
00103   unsigned char          *digest, 
00104   unsigned int           *digestLen,
00105   unsigned int           maxDigestLen,
00106   A_SURRENDER_CTX        *surrenderContext); 
00107 
00109 int C_DecomposePKCSCertRequestBER (
00110   CERT_OBJ               certObject,
00111   ATTRIBUTES_OBJ         attributesObject,
00112   unsigned char          *certRequestBER,
00113   unsigned int           certRequestBERLen, 
00114   unsigned char          *digest,
00115   unsigned int           *digestLen,
00116   A_SURRENDER_CTX        *surrenderContext);  
00117 
00119 int C_InitializeApplContext (
00120   APPL_CTX          *applContext);      /* (out) application context */
00121 
00123 void C_FinalizeApplContext (
00124   APPL_CTX          *applContext);      /* application context */
00125 
00126 #if 0 
00127 The following functions are supported via the same function definitions.
00128 The preferred method to call these functions is with a CERTC_CTX but for
00129 backward compatibility, they will take an APPL_CTX. Calling these with
00130 APPL_CTX is deprecated.
00131 
00133 int C_GetExtensionTypeInfo (
00134   APPL_CTX          applContext,        /* application context */
00135   unsigned char     *type,              /* extension OID */
00136   unsigned int      typeLen,            /* extension OID length */
00137   EXTENSION_TYPE_INFO *info);           /* extension definition */
00138 
00140 int C_RegisterExtensionType (
00141   APPL_CTX          applContext,        /* application context */
00142   EXTENSION_TYPE_INFO *info);           /* extension definition */
00143 
00145 int C_UnregisterExtensionType (
00146   APPL_CTX          applContext,        /* application context */
00147   unsigned char     *type,              /* extension OID */
00148   unsigned int      typeLen);           /* extension OID length */
00149 
00151 int C_CreateExtensionsObject (
00152   EXTENSIONS_OBJ *,
00153   unsigned int,
00154   APPL_CTX);
00155 #endif
00156                        
00157 #ifdef __cplusplus
00158 }
00159 #endif
00160 
00161 #endif /* _BCERT_H_ */



RSA BSAFE® Cert-C 2.7 API Reference