Basics: Finding certificates and validating the certification path
In order to determine whether a certificate has been issued by a certification authority that has been classified as trustworthy, a trust chain must be built. To do this, all certificates in the chain must be determined and checked. Microsoft CryptoAPI builds all possible certificate chains and returns those with the highest quality to the requesting application.

To better illustrate how this works, the following example explains the process of locating certificates using a three-tier PKI hierarchy.

- For the end-entity certificate to be verified, the download path for the CA certificate of the issuing certification authority (the issuing CA) is determined from the Authority Information Access (AIA) field. This certificate is then downloaded and saved locally.
- The end-entity certificate is now mapped to the CA certificate of the issuing CA (see the following paragraph), which must be verified next.
- For the issuing CA's certificate to be verified, the download path for the certificate of its issuing certification authority (the policy CA) is determined from its AIA field. This certificate is then downloaded and saved locally.
- The CA certificate of the issuing CA is now mapped to the CA certificate of the policy CA, which must be verified next.
- For the policy CA's certificate to be verified, the issuing certification authority (the root CA) is determined. This certificate must be in the local list of trusted root certification authorities to be recognized as valid. Even though the AIA field of the policy CA's certificate points to the root CA, and the client would thus theoretically be able to download and store it, a client would still consider the certificate untrusted unless the root CA certificate had previously been placed in the local store by a system administrator. Without this behavior, there would be no control over which CA certificates should be trusted and which should not.

Do you know TameMyCerts? TameMyCerts is an add-on for the Microsoft certification authority (Active Directory Certificate Services). It extends the function of the certification authority and enables the application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem, has already proven itself in countless companies around the world and is available under a free license. It can be downloaded via GitHub and used free of charge. Professional maintenance is also offered.
A certificate is mapped to its certification authority by comparing certain attributes within both certificates. There are three possibilities here, depending on which attributes are contained in the certificates:
- Exact Match. If the end-entity certificate contains an Authority Key Identifier (AKI) certificate extension, it is compared with the value of the Subject Key Identifier (SKI) certificate extension of the issuing certification authority's certificate. In addition, the issuer (Issuer Distinguished Name) of the certificate is compared with the subject (Subject Distinguished Name ) of the issuing certification authority's certificate.
- Key Match. If the end-entity certificate contains an Authority Key Identifier (AKI) certificate extension, it is compared with the value of the Subject Key Identifier (SKI) certificate extension of the issuing certification authority's certificate.
- Name Match. The issuer (Issuer Distinguished Name) of the certificate is compared with the subject (Subject Distinguished Name ) of the issuing certification authority's certificate. The comparison of Subject DN and Issuer DN is not carried out as a string comparison, but as a binary comparison.

