BLOBHEADER structure (wincrypt.h)

The PUBLICKEYSTRUC structure, also known as the BLOBHEADER structure, indicates a key's BLOB type and the algorithm that the key uses. One of these structures is located at the beginning of the pbData member of every key BLOB.

This structure is not limited to the key BLOBs generated by the PROV_RSA_BASE and PROV_RSA_SIG provider types. The pbData member of any new key BLOB type must begin with this structure.

Syntax

typedef struct _PUBLICKEYSTRUC {
  BYTE   bType;
  BYTE   bVersion;
  WORD   reserved;
  ALG_ID aiKeyAlg;
} BLOBHEADER, PUBLICKEYSTRUC;

Members

bType

Contains the key BLOB type.

The following are the predefined values for this member. Cryptographic service providers (CSPs) can use other type identifiers as needed.

Value Meaning
KEYSTATEBLOB
0xC
The BLOB is a key state BLOB.
OPAQUEKEYBLOB
0x9
The key is a session key.
PLAINTEXTKEYBLOB
0x8
The key is a session key.
PRIVATEKEYBLOB
0x7
The key is a public/private key pair.
PUBLICKEYBLOB
0x6
The key is a public key.
PUBLICKEYBLOBEX
0xA
The key is a public key.
SIMPLEBLOB
0x1
The key is a session key.
SYMMETRICWRAPKEYBLOB
0xB
The key is a symmetric key.

bVersion

Contains the version number of the key BLOB format. For example, if the BLOB is a Digital Signature Standard (DSS) version 3 key, this member will contain 3. The minimum value for this member is defined by the CUR_BLOB_VERSION (2) identifier.

reserved

This member is reserved for future use and must be set to zero.

aiKeyAlg

Contains one of the ALG_ID values that identifies the algorithm of the key contained by the key BLOB.

Not all algorithm identifiers are valid with all BLOB types. For example, since an RC4 key is a session key, it cannot be exported into a PUBLICKEYBLOB.

PLAINTEXTBLOBs can be used with any algorithm or type of key combination supported by the CSP in use. Note that a 3DES key cannot be imported when the Microsoft Base Provider is in use.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header wincrypt.h

See also

DSSPUBKEY

DSSSEED

RSAPUBKEY