CertCompareIntegerBlob function (wincrypt.h)

The CertCompareIntegerBlob function compares two integer BLOBs to determine whether they represent equal numeric values.

Syntax

BOOL CertCompareIntegerBlob(
  [in] PCRYPT_INTEGER_BLOB pInt1,
  [in] PCRYPT_INTEGER_BLOB pInt2
);

Parameters

[in] pInt1

A pointer to a CRYPT_INTEGER_BLOB structure that contains the first integer in the comparison.

[in] pInt2

A pointer to a CRYPT_INTEGER_BLOB structure that contains the second integer in the comparison.

Return value

If the representations of the integer BLOBs are identical and the function succeeds, the function returns nonzero (TRUE).

If the function fails, it returns zero (FALSE). For extended error information, call GetLastError.

Remarks

Before doing the comparison, most significant bytes with a value of 0x00 are removed from a positive number. Positive here means that the most significant bit in the next nonzero byte is not set.

Most significant bytes with a value of 0xFF are removed from a negative number. Negative here means that the most significant bit in the next non-0xFF byte is set. This produces the unique representation of that integer, as shown in the following table.

Original bytes Reduced form
0xFFFFFF88 0xFF88
0xFF23 0xFF23
0x007F 0x7F
0x00000080 0x80
 

Multiple-byte integers are treated as little-endian. The least significant byte is pbData[0]. The most significant byte is pbData[cbData - 1], that is, 0xFFFFFF88 is stored in four bytes as:

{0x88, 0xFF, 0xFF, 0xFF}

Examples

For an example that uses this function, see Example C Program: Using CertOIDToAlgId and CertCompareIntegerBlob.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also

CRYPT_INTEGER_BLOB

Data Management Functions

GetLastError