The CertFindRDNAttr function finds the first RDN attribute identified by its Object Identifier in the name list of the Relative Distinguished Names.
#include <wincrypt.h>
PCERT_RDN_ATTR WINAPI CertFindRDNAttr(
LPCSTR pszObjId, // in
PCERT_NAME_INFO pName // in
);
Returns a pointer to the attribute, if one is found. Otherwise, NULL is returned.
// EXAMPLE CODE FOR USING CertFindRDNAttr() to
// find the first RDN attribute identified by its Object Identifier
// in the name list of the Relative Distinguished Names.
// Assume that a pointer to the Object Identifier to use in the
// search (pszObjId) is already known and that a pointer to the name
// list of the Relative Distinguished Names to search (pName) is
// already known.
// Set up the variables.
LPCSTR pszObjId; // Initialized elsewhere
PCERT_NAME_INFO pName; // Initialized elsewhere
PCERT_RDN_ATTR pAttribute;
pAttribute = CertFindRDNAttr(pszObjId, pName);
if (pAttribute != NULL) {
// Use the found RDN attribute as desired
}
Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
Windows: Requires Windows 98 (or Windows 95 with IE 3.02 or later).
Windows CE: Unsupported.
Header: Declared in wincrypt.h.
Import Library: Use crypt32.lib.
CertFindAttribute, CertFindExtension