CMS_RECIPIENT_INFO structure

[The CMS_RECIPIENT_INFO structure is available for use in Windows XP. It might be altered or unavailable in subsequent versions.]

Contains key information for an encrypted message recipient.

Syntax

typedef struct tagCMS_RECIPIENT_INFO {
  DWORD                       dwRecipientType;
  PCCERT_CONTEXT              pccert;
  CRYPT_ALGORITHM_IDENTIFIER  KeyEncryptionAlgorithm;
  void                        *pvKeyEncryptionAuxInfo;
  DWORD                       cbKeyEncryptionAuxInfo;
  CRYPT_ALGORITHM_IDENTIFIER  KeyWrapAlgorithm;
  void                        *pvKeyWrapAuxInfo;
  DWORD                       cbKeyWrapAuxInfo;
  DWORD                       dwU1;
  union {
    CRYPT_BIT_BLOB SubjectPublicKey;
    struct {
      HCRYPTPROV hprov;
      HCRYPTKEY  hkey;
    } u2;
    struct {
      CRYPT_DATA_BLOB            UserKeyingMaterial;
      CRYPT_ALGORITHM_IDENTIFIER EphemeralAlgorithm;
      CRYPT_BIT_BLOB             SubjectPublicKey;
    } u3;
    struct {
      CRYPT_DATA_BLOB UserKeyingMaterial;
      HCRYPTPROV      hprov;
      DWORD           dwKeySpec;
      CERT_ID         senderCertId;
      CRYPT_BIT_BLOB  SubjectPublicKey;
    } u4;
  } u1;
  DWORD                       dwU3;
  union {
    CERT_ISSUER_SERIAL_NUMBER IssuerSerial;
    CRYPT_DATA_BLOB           KeyId;
  } u3;
  FILETIME                    filetime;
  PCRYPT_ATTRIBUTE_TYPE_VALUE pOtherAttr;
} CMS_RECIPIENT_INFO, *PCMS_RECIPIENT_INFO;

Members

dwRecipientType

Type: DWORD

Contains the recipient type.

Value Meaning
CMS_RECIPIENT_INFO_TYPE_UNKNOWN
0
Indicates that the type is unknown.
CMS_RECIPIENT_INFO_TYPE_KEYTRANS
1
Indicates that the recipient uses key transport algorithms.
CMS_RECIPIENT_INFO_TYPE_KEYAGREE
2
Indicates that the recipient uses key agreement algorithms.
CMS_RECIPIENT_INFO_TYPE_MAIL_LIST
3
Indicates that the recipient uses previously distributed symmetric keys.

pccert

Type: PCCERT_CONTEXT

Contains a pointer to a CERT_CONTEXT structure.

KeyEncryptionAlgorithm

Type: CRYPT_ALGORITHM_IDENTIFIER

Contains a CRYPT_ALGORITHM_IDENTIFIER structure.

pvKeyEncryptionAuxInfo

Type: void*

Contains a pointer to a structure that contains additional encryption information.

cbKeyEncryptionAuxInfo

Type: DWORD

Contains a DWORD that specifies the size (in bytes) of pvKeyEncryptionAuxInfo.

KeyWrapAlgorithm

Type: CRYPT_ALGORITHM_IDENTIFIER

Contains a CRYPT_ALGORITHM_IDENTIFIER structure.

pvKeyWrapAuxInfo

Type: void*

Contains a pointer to a structure that contains additional encryption information.

cbKeyWrapAuxInfo

Type: DWORD

Contains a DWORD that specifies the size (in bytes) of pvKeyWrapAuxInfo.

dwU1

Type: DWORD

Contains a DWORD that is used as a switch flag that indicates which set of values occupies the u1 union.

Value Meaning
CMS_RECIPIENT_INFO_PUBKEY_KEYTRANS
1
Indicates a key transport algorithm.
CMS_RECIPIENT_INFO_PUBKEY_PROVIDER
2
Indicates previously distributed keys.
CMS_RECIPIENT_INFO_PUBKEY_EPHEMERAL_KEYAGREE
3
Indicates ephemeral key agreement algorithm.
CMS_RECIPIENT_INFO_PUBKEY_STATIC_KEYAGREE
4
Indicates a store and forward key agreement algorithm.

u1

SubjectPublicKey

Type: CRYPT_BIT_BLOB

Contains a CRYPT_BIT_BLOB that contains the recipient's public key. This structure occupies the u1 union when dwU1 is equal to CMS_RECIPIENT_INFO_PUBKEY_KEYTRANS.

u2

This structure occupies the u1 union when dwU1 is equal to CMS_RECIPIENT_INFO_PUBKEY_PROVIDER.

hprov

Type: HCRYPTPROV

Contains an HCRYPTPROV handle to the CSP used to encrypt and export the recipient key.

hkey

Type: HCRYPTKEY

Contains a HCRYPTKEY handle to the cryptographic key to be used by the CSP indicated by hprov.

u3

This structure occupies the u1 union when dwU1 is equal to CMS_RECIPIENT_INFO_PUBKEY_EPHEMERAL_KEYAGREE.

UserKeyingMaterial

Type: CRYPT_DATA_BLOB

Contains a CRYPT_DATA_BLOB that contains the UKM provided by the sender.

EphemeralAlgorithm

Type: CRYPT_ALGORITHM_IDENTIFIER

Contains a CRYPT_ALGORITHM_IDENTIFIER structure containing the ephemeral public key algorithm and parameters.

SubjectPublicKey

Type: CRYPT_BIT_BLOB

Contains a CRYPT_BIT_BLOB that contains the recipient's public key.

u4

This structure occupies the u1 union when dwU1 is equal to CMS_RECIPIENT_INFO_PUBKEY_STATIC_KEYAGREE.

UserKeyingMaterial

Type: CRYPT_DATA_BLOB

Contains a CRYPT_DATA_BLOB that contains the UKM provided by the sender.

hprov

Type: HCRYPTPROV

Contains an HCRYPTPROV handle to the CSP used to encrypt and export the recipient key.

dwKeySpec

Type: DWORD

Contains the sender's private key.

senderCertId

Type: CERT_ID

Contains the CERT_ID of the sender's certificate.

SubjectPublicKey

Type: CRYPT_BIT_BLOB

Contains a CRYPT_BIT_BLOB that contains the recipient's public key.

dwU3

Type: DWORD

Contains a DWORD that is used as a switch flag that indicates which key ID type occupies the u3 union.

Value Meaning
CMS_RECIPIENT_INFO_KEYID_ISSUERSERIAL
1
Indicates that the certificate ID is stored in a CRYPT_DATA_BLOB structure.
CMS_RECIPIENT_INFO_KEYID_KEY_ID
2
Indicates that the certificate ID is stored in a CRYPT_DATA_BLOB (CRYPT_HASH_BLOB) structure.

u3

IssuerSerial

Type: CERT_ISSUER_SERIAL_NUMBER

Contains a CERT_ISSUER_SERIAL_NUMBER that contains the issuer and the issuer's serial number for a certificate. This structure occupies the u3 union when dwU3 is equal to CMS_RECIPIENT_INFO_KEYID_ISSUERSERIAL.

KeyId

Type: CRYPT_DATA_BLOB

Contains a CRYPT_DATA_BLOB that contains the a certificate key identifier. This structure occupies the u3 union when dwU3 is equal to CMS_RECIPIENT_INFO_KEYID_KEY_ID.

filetime

Type: FILETIME

Contains a FILETIME structure that contains a single KEK from a set that was previously distributed. Used when dwRecipientType is CMS_RECIPIENT_INFO_TYPE_MAIL_LIST.

pOtherAttr

Type: PCRYPT_ATTRIBUTE_TYPE_VALUE

Contains a pointer to a CRYPT_ATTRIBUTE_TYPE_VALUE structure that contains encryption attributes. Used when dwRecipientType is CMS_RECIPIENT_INFO_TYPE_MAIL_LIST.

Requirements

Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Product
Outlook Express 6.0
Header
Mimeole.h
IDL
Mimeole.idl