Countersigning a Message

To countersign a signed message by using CryptMsgCountersign

  1. Call CryptMsgOpenToDecode to get a handle to the signed message.
  2. Initialize a CMSG_SIGNER_ENCODE_INFO structure for the countersigner.
  3. Add the CMSG_SIGNER_ENCODE_INFO structure to an array of countersigners (only one countersigner is currently supported).
  4. Call CryptMsgCountersign to add the countersignature or countersignatures.

If all of the function calls succeed, the original message now has a countersignature included as an unauthenticated attribute.

To countersign a signed message by using CryptMsgCountersignEncoded

  1. Call CryptMsgOpenToDecode to get a handle to the signed message.
  2. Call CryptMsgGetParam to retrieve the encoded signer information of the signed message.
  3. Initialize a CMSG_SIGNER_ENCODE_INFO structure for the countersigner.
  4. Add the CMSG_SIGNER_ENCODE_INFO structure to an array of countersigners (only one countersigner is currently supported).
  5. Call CryptMsgCountersignEncoded to create the encoded countersignature attribute.
  6. Call CryptMsgControl to add the countersignature attribute to the original message as an unauthenticated attribute.

If all of the function calls succeed, a countersignature attribute is added to the original message.