EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

CryptMsgCountersign function

The CryptMsgCountersign function countersigns an existing signature in a message. Countersignatures are used to sign an existing signature's encrypted hash of the message. Countersignatures can be used for various purposes including time stamping a message.

Syntax


BOOL WINAPI CryptMsgCountersign(
  _Inout_  HCRYPTMSG hCryptMsg,
  _In_     DWORD dwIndex,
  _In_     DWORD cCountersigners,
  _In_     PCMSG_SIGNER_ENCODE_INFO rgCountersigners
);

Parameters

hCryptMsg [in, out]

Cryptographic message handle to be used.

dwIndex [in]

Zero-based index of the signer in the signed or signed-and-enveloped message to be countersigned.

cCountersigners [in]

Number of countersigners in the rgCountersigners array.

rgCountersigners [in]

Array of countersigners' CMSG_SIGNER_ENCODE_INFO structures.

Return value

If the function succeeds, the function returns nonzero (TRUE).

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

An error can be propagated from CryptMsgCountersignEncoded.

The following error codes are returned most often.

Return codeDescription
E_INVALIDARG

One or more arguments are not valid.

E_OUTOFMEMORY

Ran out of memory.

ERROR_MORE_DATA

The specified area is not large enough to hold the returned data.

 

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.

Examples

For an example that uses this function, see Example C Program: Encoding and Decoding a Countersigned Message.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincrypt.h

Library

Crypt32.lib

DLL

Crypt32.dll

See also

Low-level Message Functions
Simplified Message Functions
CryptMsgCountersignEncoded
CryptMsgVerifyCountersignatureEncoded

 

 

Ajouts de la communauté

AJOUTER
Afficher:
© 2014 Microsoft