CryptGetMessageSignerCount (Compact 2013)

3/28/2014

This function returns the number of signers of a signed message.

Syntax

LONG WINAPI CryptGetMessageSignerCount(
     __in  DWORD dwMsgEncodingType,
      __in  const BYTE* pbSignedBlob,
      __in  DWORD cbSignedBlob
);

Parameters

  • dwMsgEncodingType
    [in] Encoding type that is used. It is always acceptable to specify both the certificate and message encoding types by combining them with a bitwise OR operation as shown in the following example:

    X509_ASN_ENCODING | PKCS_7_ASN_ENCODING

    Currently defined encoding types are:

    • X509_ASN_ENCODING
    • PKCS_7_ASN_ENCODING
  • pbSignedBlob
    [in] Pointer to a buffer containing the signed message.
  • cbSignedBlob
    [in] Size, in bytes, of the signed message.

Return Value

Returns the number of signers of a signed message if the function succeeds, 0 (zero) when there are no signers, and -1 (minus one) for an error. To retrieve extended error information, call GetLastError.

The following error code is most commonly returned by the GetLastError function.

Value

Description

E_INVALIDARG

Invalid message encoding type. Currently, only PKCS_7_ASN_ENCODING is supported.

If the function fails, GetLastError may return an Abstract Syntax Notation One (ASN.1) encoding/decoding error. For information about these errors, see ASN.1 Encoding/Decoding Return Values.

Requirements

Header

wincrypt.h

Library

crypt32.lib

See Also

Reference

Certificates Functions