RSA Security logo

RSA BSAFE Cert-C
API Reference

pkcs10.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 _PKCS10_H_
00010 #define _PKCS10_H_ 1
00011 
00019 #include "basetype.h"
00020 #include "certapi.h"
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00062 typedef POINTER PKCS10_OBJ;
00063 
00064 #define PKCS10_VERSION_1       0
00065 #define DEFAULT_PKCS10_VERSION PKCS10_VERSION_1
00066 
00098 typedef struct {
00099   UINT2          version;
00100   NAME_OBJ       subjectName;
00101   ITEM           publicKey;
00102   ATTRIBUTES_OBJ attribute;
00103   POINTER        reserved;               /* reserved for future use  */
00104 } PKCS10_FIELDS;
00105 
00124 int C_CreatePKCS10Object(
00125   CERTC_CTX         ctx,           /* (in)  Cert-C context            */
00126   PKCS10_OBJ       *pkcs10Object); /* (out) PKCS#10 obj to be created */
00127 
00145 void C_DestroyPKCS10Object(
00146   PKCS10_OBJ       *pkcs10Object); /* (mod) PKCS#10 object to be destroyed */
00147 
00176 int C_GetPKCS10Fields(
00177   PKCS10_OBJ        pkcs10Object,  /* (in)  PKCS#10 object           */
00178   PKCS10_FIELDS    *pkcs10Fields); /* (out) extracted PKCS#10 fields */
00179 
00222 int C_SetPKCS10Fields(
00223   PKCS10_OBJ        pkcs10Object,  /* (mod) PKCS#10 object        */
00224   PKCS10_FIELDS    *pkcs10Fields); /* (in)  PKCS#10 fields to set */
00225 
00253 int C_GetPKCS10DER(
00254   PKCS10_OBJ        pkcs10Object,  /* (mod) PKCS#10 object               */
00255   unsigned char   **der,           /* (out) pointer to DER output buffer */
00256   unsigned int     *derLen);       /* (out) length  of DER output buffer */
00257 
00283 int C_SetPKCS10BER(
00284   PKCS10_OBJ        pkcs10Object,  /* (mod) PKCS#10 object             */
00285   unsigned char    *ber,           /* (in)  BER input buffer           */
00286   unsigned int      berLen);       /* (in)  BER input buffer length    */
00287 
00307 int C_SignPKCS10(
00308   PKCS10_OBJ        pkcs10Object,      /* (mod) PKCS#10 object         */
00309   B_KEY_OBJ         subjectPrivateKey, /* (in)  subject private key    */
00310   int               signAlgorithmID);  /* (in)  signature algorithm ID */
00311 
00323 int C_VerifyPKCS10Signature(
00324   PKCS10_OBJ        pkcs10Object);     /* (in)  PKCS#10 object         */
00325 
00326 #ifdef __cplusplus
00327 }
00328 #endif
00329 
00330 #endif /* _PKCS10_H_ */



RSA BSAFE® Cert-C 2.7 API Reference