共用方式為


CertIsRDNAttrsInCertificateName

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function compares the attributes in the certificate name with the specified CERT_RDN structure to determine whether all attributes are included there. The comparison iterates through the CERT_RDN structure and looks for an attribute match in any of the certificate name's CERT_RDN structures.

Syntax

BOOL WINAPI CertIsRDNAttrsInCertificateName(
  DWORD dwCertEncodingType,
  DWORD dwFlags,
  PCERT_NAME_BLOB pCertName,
  PCERT_RDN pRDN
);

Parameters

  • dwCertEncodingType
    [in] Specifies the encoding type used. Currently, only X509_ASN_ENCODING is used; however, additional encoding types may be added in the future.
  • dwFlags
    [in] Bitmask of flags. A value of CERT_UNICODE_IS_RDN_ATTRS_FLAG must be set if the pRDN parameter was initialized with UNICODE strings as in the CryptEncodeObject function with the lpszStructType parameter set to X509_UNICODE_NAME.

    CERT_CASE_INSENSITIVE_IS_RDN_ATTRS_FLAG is set to do a case-insensitive match. Otherwise, an exact, case-sensitive match is done.

  • pCertName
    [in] Pointer to a BLOB containing the encoded subject or issuer name.
  • pRDN
    [in] Array of CERT_RDN structures containing the attributes to be found in the name. The CERT_RDN_ATTR member of the CERT_RDN structure adheres to the following rules:

    • If pszObjId is NULL, the attribute object identifier (OID) is ignored.
    • If dwValueType is CERT_RDN_ANY_TYPE, the value type is ignored.
    • If the pbData member of Value is NULL, any value can be a match.

Return Value

If the function succeeds, the return value is nonzero, or TRUE.

If the function fails, the return value is zero, or FALSE.

For extended error information, call the GetLastError function.

The following table shows the error codes for this function.

Error code Description

CRYPT_E_NO_MATCH

Not all the attributes were found and matched.

ERROR_FILE_NOT_FOUND

Invalid certificate encoding type. Currently only X509_ASN_ENCODING is supported.

Remarks

Currently, only an exact, case-sensitive match is supported.

The desktop operating system supports the flag PKCS_7_ASN_ENCODING, but Windows Embedded CE does not and ignores the flag when it is specified.

Requirements

Header wincrypt.h
Library crypt32.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

CertFindCertificateInStore
BLOB (Cryptography)
CERT_RDN
CERT_RDN_ATTR