CMSG_SIGNER_ENCODE_INFO

The CMSG_SIGNER_ENCODE_INFO structure is used to specify the signer information. This structure is passed to CryptMsgCountersign, CryptMsgCountersignEncoded, and optionally to CryptMsgOpenToEncode as a member of CMSG_SIGNED_ENCODE_INFO for a value of CMSG_SIGNED in dwMsgType.

typedef struct _CMSG_SIGNER_ENCODE_INFO {
    DWORD                       cbSize;
    PCERT_INFO                  pCertInfo;
    HCRYPTPROV                  hCryptProv;
    DWORD                       dwKeySpec;
    CRYPT_ALGORITHM_IDENTIFIER  HashAlgorithm;
    void*                       pvHashAuxInfo;
    DWORD                       cAuthAttr;
    PCRYPT_ATTRIBUTE            rgAuthAttr;
    DWORD                       cUnauthAttr;
    PCRYPT_ATTRIBUTE            rgUnauthAttr;
} CMSG_SIGNER_ENCODE_INFO,   *PCMSG_SIGNER_ENCODE_INFO;
 

Members

cbSize
The count of bytes in this data structure.
pCertInfo
The following data structures from the specified CERT_INFO are used:

Issuer

SerialNumber

SubjectPublicKeyInfo.Algorithm

The contents of the Issuer and SerialNumber data structures, combined are a unique identifier of a certificate. The Algorithm member of the SubjectPublicKeyInfo data structure specifies the hash encryption algorithm used.

hCryptProv
A handle to the cryptographic service provider.
dwKeySpec
Used to specify the private key to be used.

The following dwKeySpec values are defined in Wincrypt.h for the default provider:

#define AT_KEYEXCHANGE              1
#define AT_SIGNATURE                2
 

If dwKeySpec is zero, then the default AT_SIGNATURE is used.

HashAlgorithm
A hash algorithm.
pvHashAuxInfo
Currently not used and must be set to NULL in the interim.
cAuthAttr
The number of elements in the array rgAuthAttr.
rgAuthAttr
An array of structures, each holding authenticated attribute information. If no authenticated attributes are present in rgAuthAttr, then cAuthAttr should be zero. If there are authenticated attributes present, then the PKCS #9 standard dictates that there must be at least two attributes present, the content type object identifier, and the hash of the message itself. These attributes are automatically added by the system.
cUnauthAttr
The number of elements in the array rgUnauthAttr.
rgUnauthAttr
An array of structures, each holding unauthenticated attribute information. If no unauthenticated attributes are present in rgUnauthAttr, then cUnauthAttr should be zero. Unauthenticated attributes may be used to contain countersignatures, among other uses.

See Also

CERT_INFO, CRYPT_ALGORITHM_IDENTIFIER, CRYPT_ATTRIBUTE, CryptMsgControl, CryptMsgCountersign