RSA BSAFE Cert-C

Certificate Components for C

Crypto-C 6.2.1 Developer's Guide
Search

BIT_STRING Reference

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

This structure is used with C_BERDecodeBitString(), C_DEREncodeBitString() and C_DEREncodeNamedBitString(). 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;

Samples:

demoutil.c, and pkcs10.c.

#include <basetype.h>

typedef struct BIT_STRING {
  unsigned char *data;
  unsigned int len;
  unsigned int unusedBits;
} 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

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.


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