CRYPT_RDN_ATTR_OID_GROUP_ID

For the CRYPT_RDN_ATTR_OID_GROUP_ID, the following predefined entries exist. Note that the varying members of the CRYPT_OID_INFO structure for this group are shown in the table. These correspond to the find criteria that should be used for this group when making calls to CryptFindOIDInfo. The values for members that do not vary for entries in this group are typically set to zero, or NULL, except that cbSize which always is set to the size of CRYPT_OID_INFO, and the dwGroupId always is set to this group.

pszOID pwszName Extra Info
see Note below
szOID_COMMON_NAME L"CN" N/A
szOID_LOCALITY_NAME L"L" N/A
szOID_ORGANIZATION_NAME L"O" N/A
szOID_ORGANIZATIONAL_UNIT_NAME L"OU" N/A
szOID_RSA_emailAddr L"Email" rgdwIA5ValueType
szOID_COUNTRY_NAME L"C" rgdwPrintableValueType
szOID_STATE_OR_PROVINCE_NAME L"S" N/A
szOID_STATE_OR_PROVINCE_NAME L"ST" N/A
szOID_STREET_ADDRESS L"STREET" N/A
szOID_TITLE L"T" N/A
szOID_TITLE L"Title" N/A
szOID_GIVEN_NAME L"G" N/A
szOID_GIVEN_NAME L"GN" N/A
szOID_GIVEN_NAME L"GivenName" N/A
szOID_INITIALS L"I" N/A
szOID_INITIALS L"Initials" N/A
szOID_SUR_NAME L"SN" N/A
szOID_DEVICE_SERIAL_NUMBER L"" rgdwPrintableValueType
szOID_DOMAIN_COMPONENT L"DC" rgdwIA5ValueType
szOID_DESCRIPTION L"" N/A
szOID_BUSINESS_CATEGORY L"" N/A
szOID_POSTAL_CODE L"" N/A
szOID_POST_OFFICE_BOX L"" N/A
szOID_PHYSICAL_DELIVERY_OFFICE_NAME L"" N/A
szOID_TELEPHONE_NUMBER L"" rgdwPrintableValueType
szOID_X21_ADDRESS L"" rgdwNumericValueType
szOID_INTERNATIONAL_ISDN_NUMBER L"" rgdwNumericValueType
szOID_DESTINATION_INDICATOR L"" rgdwPrintableValueType

Note  For the Extra Info rgdwIA5ValueType,
static const DWORD rgdwIA5ValueType[] =
                                    { CERT_RDN_IA5_STRING, 0 };
    cbData = sizeof( rgdwIA5ValueType);
    pbData = (BYTE *) &rgdwIA5ValueType;

For the Extra Info rgdwPrintableValueType,
static const DWORD rgdwPrintableValueType[] = {
                                    CERT_RDN_PRINTABLE_STRING, 0 };
    cbData = sizeof( rgdwPrintableValueType);
    pbData = (BYTE *) &rgdwPrintableValueType;

For the Extra Info rgdwNumericValueType,
static const DWORD rgdwNumericValueType[] = {
                                        CERT_RDN_NUMERIC_STRING, 0 };
                             CRYPT_OID_INHIBIT_SIGNATURE_FORMAT_FLAG};
    cbData = sizeof( rgdwNumericValueType);
    pbData = (BYTE *) &rgdwNumericValueType;

The C code used to populate the table (an array of CCRYPT_OID_INFO structures) is shown below.

C code specifying table.

//+-------------------------------------------------------------------------
//  RDN Attribute Table
//--------------------------------------------------------------------------

// PLEASE UPDATE the following define in certstr.cpp if you add a new entry
// with a longer pwszName
// #define MAX_X500_KEY_LEN    64

// Ordered lists of acceptable RDN attribute value types. 0 terminates.
static const DWORD rgdwPrintableValueType[] = { CERT_RDN_PRINTABLE_STRING, 0 };
static const DWORD rgdwIA5ValueType[] = { CERT_RDN_IA5_STRING, 0 };
static const DWORD rgdwNumericValueType[] = { CERT_RDN_NUMERIC_STRING, 0 };

#define RDN_ATTR_ENTRY(pszOID, pwszName, rgdwValueType) \
    OID_INFO_LEN, pszOID, pwszName, CRYPT_RDN_ATTR_OID_GROUP_ID, 0, \
    sizeof(rgdwValueType), (BYTE *) rgdwValueType
#define DEFAULT_RDN_ATTR_ENTRY(pszOID, pwszName) \
    OID_INFO_LEN, pszOID, pwszName, CRYPT_RDN_ATTR_OID_GROUP_ID, 0, 0, NULL
    
static CCRYPT_OID_INFO RDNAttrTable[] = {
    // Ordered with most commonly used key names at the beginning

    // Labeling attribute types:
    DEFAULT_RDN_ATTR_ENTRY(szOID_COMMON_NAME, L"CN"),
    // Geographic attribute types:
    DEFAULT_RDN_ATTR_ENTRY(szOID_LOCALITY_NAME, L"L"),
    // Organizational attribute types:
    DEFAULT_RDN_ATTR_ENTRY(szOID_ORGANIZATION_NAME, L"O"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_ORGANIZATIONAL_UNIT_NAME, L"OU"),

    // Verisign sticks the following in their cert names
    RDN_ATTR_ENTRY(szOID_RSA_emailAddr, L"Email", rgdwIA5ValueType),

    // The following aren't used in Verisign's certs

    // Geographic attribute types:
    RDN_ATTR_ENTRY(szOID_COUNTRY_NAME, L"C", rgdwPrintableValueType),
    DEFAULT_RDN_ATTR_ENTRY(szOID_STATE_OR_PROVINCE_NAME, L"S"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_STATE_OR_PROVINCE_NAME, L"ST"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_STREET_ADDRESS, L"STREET"),

    // Organizational attribute types:
    DEFAULT_RDN_ATTR_ENTRY(szOID_TITLE, L"T"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_TITLE, L"Title"),

    DEFAULT_RDN_ATTR_ENTRY(szOID_GIVEN_NAME, L"G"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_GIVEN_NAME, L"GN"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_GIVEN_NAME, L"GivenName"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_INITIALS, L"I"),
    DEFAULT_RDN_ATTR_ENTRY(szOID_INITIALS, L"Initials"),

    // Labeling attribute types:
    DEFAULT_RDN_ATTR_ENTRY(szOID_SUR_NAME, L"SN"),
    RDN_ATTR_ENTRY(szOID_DEVICE_SERIAL_NUMBER, L"", rgdwPrintableValueType),

    // Pilot user attribute types:
    RDN_ATTR_ENTRY(szOID_DOMAIN_COMPONENT, L"DC", rgdwIA5ValueType),

    // Explanatory attribute types:
    DEFAULT_RDN_ATTR_ENTRY(szOID_DESCRIPTION, L""),
//  szOID_SEARCH_GUIDE                  "2.5.4.14"
    DEFAULT_RDN_ATTR_ENTRY(szOID_BUSINESS_CATEGORY, L""),

    // Postal addressing attribute types:
//  szOID_POSTAL_ADDRESS                "2.5.4.16"
    DEFAULT_RDN_ATTR_ENTRY(szOID_POSTAL_CODE, L""), 
    DEFAULT_RDN_ATTR_ENTRY(szOID_POST_OFFICE_BOX, L""), 
    DEFAULT_RDN_ATTR_ENTRY(szOID_PHYSICAL_DELIVERY_OFFICE_NAME, L""), 

    // Telecommunications addressing attribute types:
    RDN_ATTR_ENTRY(szOID_TELEPHONE_NUMBER, L"", rgdwPrintableValueType),
//  szOID_TELEX_NUMBER                  "2.5.4.21"
//  szOID_TELETEXT_TERMINAL_IDENTIFIER  "2.5.4.22"
//  szOID_FACSIMILE_TELEPHONE_NUMBER    "2.5.4.23"
    RDN_ATTR_ENTRY(szOID_X21_ADDRESS, L"", rgdwNumericValueType),
    RDN_ATTR_ENTRY(szOID_INTERNATIONAL_ISDN_NUMBER, L"", rgdwNumericValueType),
//  szOID_REGISTERED_ADDRESS            "2.5.4.26"
    RDN_ATTR_ENTRY(szOID_DESTINATION_INDICATOR, L"", rgdwPrintableValueType)

    // Preference attribute types:
//  szOID_PREFERRED_DELIVERY_METHOD     "2.5.4.28"

    // OSI application attribute types:
//  szOID_PRESENTATION_ADDRESS          "2.5.4.29"
//  szOID_SUPPORTED_APPLICATION_CONTEXT "2.5.4.30"

    // Relational application attribute types:
//  szOID_MEMBER                        "2.5.4.31"
//  szOID_OWNER                         "2.5.4.32"
//  szOID_ROLE_OCCUPANT                 "2.5.4.33"
//  szOID_SEE_ALSO                      "2.5.4.34"

    // Security attribute types:
//  szOID_USER_PASSWORD                 "2.5.4.35"
//  szOID_USER_CERTIFICATE              "2.5.4.36"
//  szOID_CA_CERTIFICATE                "2.5.4.37"
//  szOID_AUTHORITY_REVOCATION_LIST     "2.5.4.38"
//  szOID_CERTIFICATE_REVOCATION_LIST   "2.5.4.39"
//  szOID_CROSS_CERTIFICATE_PAIR        "2.5.4.40"

    // Undocumented attribute types???
//#define szOID_???                         "2.5.4.41"
};
#define RDN_ATTR_CNT (sizeof(RDNAttrTable) / sizeof(RDNAttrTable[0]))