RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

pkcs10.h

Go to the documentation of this file.
00001 /* $Id: pkcs10.h,v 1.9 2005/01/25 05:50:29 jmckee Exp $ */
00002 /*
00003 * Copyright (c) RSA Security Inc., 1999-2002.  All rights reserved.
00004 * This work contains proprietary, confidential, and trade secret
00005 * information of RSA Security Inc.  Use, disclosure or reproduction
00006 * without the express written authorization of RSA Security Inc. is
00007 * prohibited.
00008 */
00009 
00010 #ifndef _PKCS10_H_
00011 #define _PKCS10_H_ 1
00012 
00020 #include "basetype.h"
00021 #include "certapi.h"
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00033 typedef POINTER PKCS10_OBJ;
00034 
00035 #define PKCS10_VERSION_1       0
00036 #define DEFAULT_PKCS10_VERSION PKCS10_VERSION_1
00037 
00045 typedef struct {
00046 
00051   UINT2          version;
00052 
00057   NAME_OBJ       subjectName;
00058 
00065   ITEM           publicKey;
00066 
00071   ATTRIBUTES_OBJ attribute;
00072 
00076   POINTER        reserved;
00077 } PKCS10_FIELDS;
00078 
00079 int C_CreatePKCS10Object(
00080   CERTC_CTX         ctx,           /* (in)  Cert-C context            */
00081   PKCS10_OBJ       *pkcs10Object); /* (out) PKCS#10 obj to be created */
00082 
00083 void C_DestroyPKCS10Object(
00084   PKCS10_OBJ       *pkcs10Object); /* (mod) PKCS#10 object to be destroyed */
00085 
00086 int C_GetPKCS10Fields(
00087   PKCS10_OBJ        pkcs10Object,  /* (in)  PKCS#10 object           */
00088   PKCS10_FIELDS    *pkcs10Fields); /* (out) extracted PKCS#10 fields */
00089 
00090 int C_SetPKCS10Fields(
00091   PKCS10_OBJ        pkcs10Object,  /* (mod) PKCS#10 object        */
00092   PKCS10_FIELDS    *pkcs10Fields); /* (in)  PKCS#10 fields to set */
00093 
00094 int C_GetPKCS10DER(
00095   PKCS10_OBJ        pkcs10Object,  /* (mod) PKCS#10 object               */
00096   unsigned char   **der,           /* (out) pointer to DER output buffer */
00097   unsigned int     *derLen);       /* (out) length  of DER output buffer */
00098 
00099 int C_SetPKCS10BER(
00100   PKCS10_OBJ        pkcs10Object,  /* (mod) PKCS#10 object             */
00101   unsigned char    *ber,           /* (in)  BER input buffer           */
00102   unsigned int      berLen);       /* (in)  BER input buffer length    */
00103 
00104 int C_SignPKCS10(
00105   PKCS10_OBJ        pkcs10Object,      /* (mod) PKCS#10 object         */
00106   B_KEY_OBJ         subjectPrivateKey, /* (in)  subject private key    */
00107   int               signAlgorithmID);  /* (in)  signature algorithm ID */
00108 
00109 int C_VerifyPKCS10Signature(
00110   PKCS10_OBJ        pkcs10Object);     /* (in)  PKCS#10 object         */
00111 
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115 
00116 #endif /* _PKCS10_H_ */

Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 067-001001-2720-001-000 - 2.7.2