RSA Security logo

RSA BSAFE Cert-C
API Reference

BIT_STRING Reference

A low-level structure that holds an ordered sequence of bits.

The BIT_STRING structure is used with the C_BERDecodeBitString(), C_DEREncodeBitString(), and C_DEREncodeNamedBitString() functions. It is also used in the CERT_FIELDS structure.

For example, given the following 12-bit string: 1011 0000 1001

Create the following BIT_STRING structure:

    BIT_STRING newBitString;
    unsigned char bitData[2];

    bitData[0] = 0xB0;
    bitData[1] = 0x90;
    newBitString.data = bitData;
    newBitString.len = 2;
    newBitString.unusedBits = 4;
 

#include <basetype.h>

00053 typedef struct BIT_STRING {
00059   unsigned char *data;                           /* data is right justified */
00064   unsigned int len;
00073   unsigned int unusedBits;                   /* number of unused bits in the
00074                                                 last byte in the data field */
00075 } BIT_STRING;

Data Fields

unsigned char * data
 A pointer to an unsigned char array that holds the data comprising the bit string.

unsigned int len
 An unsigned int value that indicates the length, in bytes, of the data.

unsigned int unusedBits
 An unsigned int value that specifies the number of bits in data, in the least significant positions, that are not part of the bit string. More...


Field Documentation (alphabetical)

unsigned int unusedBits
 

An unsigned int value that specifies the number of bits in data, in the least significant positions, that are not part of the bit string. This value is a number from 0 to 7. These bits are ignored.


The documentation for this struct was generated from the following file:


RSA BSAFE® Cert-C 2.7 API Reference