Countersigning a Message
To countersign a signed message by using CryptMsgCountersign
- Call CryptMsgOpenToDecode to get a handle to the signed message.
- Initialize a CMSG_SIGNER_ENCODE_INFO structure for the countersigner.
- Add the CMSG_SIGNER_ENCODE_INFO structure to an array of countersigners (only one countersigner is currently supported).
- 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
- Call CryptMsgOpenToDecode to get a handle to the signed message.
- Call CryptMsgGetParam to retrieve the encoded signer information of the signed message.
- Initialize a CMSG_SIGNER_ENCODE_INFO structure for the countersigner.
- Add the CMSG_SIGNER_ENCODE_INFO structure to an array of countersigners (only one countersigner is currently supported).
- Call CryptMsgCountersignEncoded to create the encoded countersignature attribute.
- 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.