Platform SDK: Cryptography

Symmetric Wrapped Key BLOBs

The Symmetric Wrapped Key BLOB format is used to export and import a symmetric key wrapped with another symmetric key. The actual wrapped key is in the format specified in the IETF SMIME X9.42 standard.

BLOBHEADER blobheader;  
ALG_ID WrapAlgid;  
BYTE Blob[variable length];

This BLOB format is exported when the SYMMETRICWRAPKEYBLOB type is used with CryptExportKey. When exporting a BLOB of this type, both the hKey and hExpKey parameters to the CryptExportKey call must contain valid symmetric key handles. When calling CryptImportkey and using a BLOB of this type, the hImpKey parameter must contain a valid and correct handle to a symmetric key.

The following table describes each component of the key BLOB.

Field Description
Blobheader BLOBHEADER structure. The bType member must have a value of SYMMETRICWRAPKEYBLOB, bVersion must be 2 and aiKeyAlgid must be the algorithm identifier for the wrapped key.
WrapAlgid Algorithm identifier for the wrapping key.
Blob BLOB value. This needs to be in the symmetric key wrapping format specified in the IETF SMIME X9.42 standard.