ICertEncodeBitString interface (certenc.h)

The ICertEncodeBitString interface provides methods for handling bit strings used in certificate extensions. A certificate extension can be created by using a bit string stored in an extension handler COM object instantiated by the policy module. The bit string can contain an arbitrary string of binary values. This interface is useful for encoding and decoding szOID_KEY_USAGE "" extensions; the SDK sample policy module uses this interface.

ICertEncodeBitString is defined in Certenc.h. When you create your program, however, use Certsrv.h as the include file. Certenc.dll provides the ICertEncodeBitString interface. The type information for this interface is also in Certencl.dll, which is shipped with the Platform Software Development Kit (SDK).

Certificate Services interfaces support both apartment-threading and free-threading models. For better throughput, free threading is recommended.


The ICertEncodeBitString interface inherits from the IDispatch interface. ICertEncodeBitString also has these types of members:


The ICertEncodeBitString interface has these methods.


Decodes an Abstract Syntax Notation One (ASN.1)-encoded bit string and stores the resulting bit string in this object.

Performs Abstract Syntax Notation One (ASN.1) encoding on a given bit string.

Returns the number of bits in a bit string that belongs to the CertEncodeBitString object and has been initialized by an earlier call to ICertEncodeBitString::Decode.

Returns the string of bits in the object's bit string.


Minimum supported client None supported
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header certenc.h (include Certsrv.h)