RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

pkcs10.h File Reference

This file contains the Cert-C certificate request object API and data types.

#include "basetype.h"
#include "certapi.h"

Go to the source code of this file.

Data Structures

struct  PKCS10_FIELDS
 Allows viewing and updating of an opaque PKCS10_OBJ. More...


Typedefs

typedef POINTER PKCS10_OBJ
 Cert-C represents certificate-request information with a PKCS10_OBJ. More...


Functions

int C_CreatePKCS10Object (CERTC_CTX ctx, PKCS10_OBJ *pkcs10Object)
 Creates a PKCS #10 certificate-request object. More...

void C_DestroyPKCS10Object (PKCS10_OBJ *pkcs10Object)
 Destroys a PKCS #10 object and frees the memory used by obj. More...

int C_GetPKCS10Fields (PKCS10_OBJ pkcs10Object, PKCS10_FIELDS *pkcs10Fields)
 Fills pkcs10Fields with the values found in the PKCS10_FIELDS data structure in pkcs10Object. More...

int C_SetPKCS10Fields (PKCS10_OBJ pkcs10Object, PKCS10_FIELDS *pkcs10Fields)
 Sets pkcs10Object to contain the value in pkcs10Fields. More...

int C_GetPKCS10DER (PKCS10_OBJ pkcs10Object, unsigned char **der, unsigned int *derLen)
 Obtains the DER encoding of the value of pkcs10Object, and stores a pointer to the DER encoding in pcks10DER and its length in pkcs10DERLen. More...

int C_SetPKCS10BER (PKCS10_OBJ pkcs10Object, unsigned char *ber, unsigned int berLen)
 Modifies the value of obj to the BER-encoded values given in certReqBER and certReqBERLen. More...

int C_SignPKCS10 (PKCS10_OBJ pkcs10Object, B_KEY_OBJ subjectPrivateKey, int signAlgorithmID)
 Signs a PKCS #10 object using subjectPrivateKey. More...

int C_VerifyPKCS10Signature (PKCS10_OBJ pkcs10Object)
 Checks the signature of the certificate in obj using the public key in obj. More...


Typedef Documentation

typedef POINTER PKCS10_OBJ
 

Cert-C represents certificate-request information with a PKCS10_OBJ. It is necessary to use a Cert-C function to view or modify information in a PKCS10_OBJ object.


Function Documentation

int C_CreatePKCS10Object CERTC_CTX    ctx,
PKCS10_OBJ   obj
;
 

Creates a PKCS #10 certificate-request object. If this function is unsuccessful, no memory will be allocated and obj will be set to (PKCS10_OBJ)NULL_PTR.

Parameters:
ctx [In] A pointer to an initialized Cert-C context.
obj [Out] A pointer to the location where the new PKCS #10 request object is to be created. The object keeps a pointer to the current Cert-C context.
Returns:
0 indicates success.
See Errors for error information.
Samples:
fulfill.c, genreq.c, and pkcs10.c.

void C_DestroyPKCS10Object PKCS10_OBJ   obj ;
 

Destroys a PKCS #10 object and frees the memory used by obj. It sets obj to (PKCS10_OBJ)NULL_PTR. No action is taken if obj is already (PKCS10_OBJ)NULL_PTR.

Parameters:
obj [In, Out] As an input parameter, it is the PKCS #10 object that Cert-C should destroy. As an output parameter, it is (LIST_OBJ)NULL_PTR.
Returns:
None.
Samples:
fulfill.c, genreq.c, and pkcs10.c.

int C_GetPKCS10DER PKCS10_OBJ    pkcs10Object,
unsigned char **    pkcs10DER,
unsigned int *    pkcs10DERLen
;
 

Obtains the DER encoding of the value of pkcs10Object, and stores a pointer to the DER encoding in pcks10DER and its length in pkcs10DERLen.

Parameters:
pkcs10Object [In] The PKCS #10 object.
pkcs10DER [Out] A pointer to the DER-encoded pkcs10Object value.
pkcs10DERLen [Out] A pointer to the length of the DER-encoded pkcs10Object value.
Returns:
0 indicates success.
See Errors for error information.
note.gif
This function returns read-only fields. Do not create any objects or or items before calling this function. Do not call any functions, such as C_Destroy*(), that modify these fields.
Samples:
pkcs10.c.

int C_GetPKCS10Fields PKCS10_OBJ    pkcs10Object,
PKCS10_FIELDS   pkcs10Fields
;
 

Fills pkcs10Fields with the values found in the PKCS10_FIELDS data structure in pkcs10Object. This may be the actual value or the current working value of the pkcs10Object, depending on whether C_SetPKCS10Fields() is called before calling this function.

Parameters:
pkcs10Object [In] The PKCS #10 object.
pkcs10Fields [Out] The data structure for the PKCS #10 information.
Returns:
0 indicates success.
See Errors for error information.
note.gif
Do not create any objects or items before calling this function. After calling this function, the returned fields are shared with the pkcs10Object. If you modify any of these fields, call C_SetPKCS10Fields() to ensure that the internal state of the object is consistent with these modifications.
Samples:
fulfill.c, p10util.c, and pkcs10.c.

int C_SetPKCS10BER PKCS10_OBJ    obj,
unsigned char *    certReqBER,
unsigned int    certReqBERLen
;
 

Modifies the value of obj to the BER-encoded values given in certReqBER and certReqBERLen. A separate copy of the BER-encoded obj value is allocated inside the PKCS #10 object, so that certReqBER can be changed after calling this function.

Parameters:
obj [In, Out] As an input parameter, it is the PKCS #10 object that Cert-C should update. As an output parameter, it is the updated PKCS #10 object.
certReqBER [In] The BER-encoded PKCS #10 object.
certReqBERLen [In] The length of the BER-encoded PKCS #10 object.
Returns:
0 indicates success.
See Errors for error information.
Samples:
fulfill.c, and pkcs10.c.

int C_SetPKCS10Fields PKCS10_OBJ    pkcs10Object,
PKCS10_FIELDS   pkcs10Fields
;
 

Sets pkcs10Object to contain the value in pkcs10Fields. The value in pkcs10Fields can be the current working value of pkcs10Object, or of another PKCS #10 object. After calling this function, the value in pkcs10Fields becomes the actual value of pkcs10Object.

Parameters:
pkcs10Object [In, Out] The PKCS #10 object.
pkcs10Fields [In] The data structure for the PKCS #10 information. The subjectName field is a NAME_OBJ object that represents the subject of pkcs10Object. The publicKey field is an ITEM that gives the DER encoding of the subject's public key. The attributes field is an ATTRIBUTES_OBJ object that contains additional information about the subject of the certificate request. If the certificate request needs to include X.509 v3 certificate extensions, the caller can add an attribute of type AT_X509_V3_EXTENSIONS and type length AT_X509_V3_EXTENSIONS_LEN, whose value is the encoding of extensions before this call. If any field in pkcs10Fields is created by the caller, or is different from the result returned by C_GetPKCS10Fields(), then that field in pkcs10Object is replaced with the value passed in pkcs10Fields. The replacement is a separate copy of the value in pkcs10Fields, and may be modified or destroyed after calling this function.
Returns:
0 indicates success.
See Errors for error information.
Samples:
p10util.c.

int C_SignPKCS10 PKCS10_OBJ    obj,
B_KEY_OBJ    subjectPrivateKey,
int    signAlgorithmID
;
 

Signs a PKCS #10 object using subjectPrivateKey.

Parameters:
obj [In, Out] The PKCS #10 object.
subjectPrivateKey [In] The private key used to sign obj.
signAlgorithmID [In] The signature algorithm identifier. Values for this parameter may be any of the SA_* values.
Returns:
0 indicates success.
See Errors for error information.
Samples:
genreq.c, and p10util.c.

int C_VerifyPKCS10Signature PKCS10_OBJ    obj ;
 

Checks the signature of the certificate in obj using the public key in obj.

Parameters:
obj [In] The PKCS #10 object.
Returns:
0 indicates success.
See Errors for error information.
Samples:
fulfill.c, and pkcs10.c.


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