RSA Security logo

RSA BSAFE Cert-C
API Reference

altname.h File Reference

This file creates, frees, encodes, and decodes GENERAL_NAME structures.

#include "basetype.h"
#include "certext.h"

Go to the source code of this file.

Functions

int C_CopyGeneralName (GENERAL_NAME *newGenName, GENERAL_NAME *oldGenName)
 Copies all of the members of an old GENERAL_NAME structure into a new GENERAL_NAME structure. More...

void C_FreeGeneralName (GENERAL_NAME *genName)
 Frees all the memory associated with the members of a GENERAL_NAME data structure. More...

int C_BERDecodeGeneralName (CERTC_CTX ctx, unsigned char *inputBER, unsigned int inputLen, GENERAL_NAME *genName)
 Decodes a BER-encoded GENERAL_NAME value into a GENERAL_NAME data structure. More...

int C_DEREncodeGeneralName (CERTC_CTX ctx, GENERAL_NAME *genName, unsigned char **outputDER, unsigned int *outputLen)
 DER encodes a GENERAL_NAME data structure into the equivalent ASN.1 data type. More...


Function Documentation

int C_BERDecodeGeneralName CERTC_CTX    ctx,
unsigned char *    inputBER,
unsigned int    inputLen,
GENERAL_NAME   genName
;
 

Decodes a BER-encoded GENERAL_NAME value into a GENERAL_NAME data structure. The caller must allocate memory for the GENERAL_NAME structure itself, but does not need to allocate memory to hold the members of the GENERAL_NAME structure. The caller is responsible for freeing the memory associated with the GENERAL_NAME structure itself, and should call C_FreeGeneralName() to free the memory used by the members of the GENERAL_NAME structure.

Parameters:
ctx This input parameter specifies the Cert-C context.
inputBER This input parameter points to the BER-encoded GENERAL_NAME value.
inputLen This input parameter is the length, in bytes, of the encoding.
genName This output parameter points to a pre-allocated GENERAL_NAME structure that contains the decoded information.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int C_CopyGeneralName GENERAL_NAME   newGenName,
GENERAL_NAME   oldGenName
;
 

Copies all of the members of an old GENERAL_NAME structure into a new GENERAL_NAME structure. It is necessary to pre-allocate the GENERAL_NAME structure that will hold the new general name, but it is not necessary to pre-allocate the members of the structure that will hold the new general name.

Parameters:
newGenName This output parameter points to the new copy of the GENERAL_NAME structure. It is necessary to pre-allocate this structure, but it is not necessary to pre-allocate the members of the structure.
oldGenName This input parameter points to the GENERAL_NAME structure to be copied.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

int C_DEREncodeGeneralName CERTC_CTX    ctx,
GENERAL_NAME   genName,
unsigned char **    outputDER,
unsigned int *    outputLen
;
 

DER encodes a GENERAL_NAME data structure into the equivalent ASN.1 data type. The application can call T_free to free the buffer returned in outputDER.

Parameters:
ctx This input parameter specifies the Cert-C context.
genName This input parameter points to the GENERAL_NAME structure to be encoded.
outputDER This output parameter points to a dynamically allocated output buffer in which the DER encoding is returned.
outputLen This output parameter points to the length, in bytes, of the encoding.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.

void C_FreeGeneralName GENERAL_NAME   genName ;
 

Frees all the memory associated with the members of a GENERAL_NAME data structure. It does not free the GENERAL_NAME structure itself.

Parameters:
genName This input and output parameter points to a GENERAL_NAME structure in memory.
Returns:
If successful, returns 0. If not, returns a Cert-C error code.



RSA BSAFE® Cert-C 2.7 API Reference