Ejemplo n.º 1
0
        public static byte[] GetRootCertificateHash(byte[] imageBytes)
        {
            List <byte[]> certificates         = ApplicationExecutableHelper.ExtractCertificates(imageBytes);
            int           rootCertificateIndex = CertificateValidationHelper.GetRootCertificateIndex(certificates);

            if (rootCertificateIndex == -1)
            {
                return(null);
            }

            byte[] rootCertificate = certificates[rootCertificateIndex];
            return(SHA256.Create().ComputeHash(rootCertificate));
        }
Ejemplo n.º 2
0
        public static bool VerifyCertificateStore(byte[] imageBytes)
        {
            List <byte[]> certificates = ApplicationExecutableHelper.ExtractCertificates(imageBytes);

            return(CertificateValidationHelper.VerifyCertificateChain(certificates));
        }