public static bool HasSameRootCertificateHash(this X509Certificate2 externalCertificate, byte[] internalRooCertHash)
        {
            X509Chain chain = new X509Chain {
                ChainPolicy = { RevocationMode = X509RevocationMode.NoCheck }
            };

            chain.Build(externalCertificate);

            return(chain.HasSameRootCertificateHash(internalRooCertHash));
        }