コード例 #1
0
        static JObject GetIntegrityHeader(string SignerCertPath)
        {
            var    signerCert  = CertificateUtil.GetBase64CertContent(SignerCertPath);
            var    signerCert1 = signerCert.Substring(0, signerCert.Length / 2);
            var    signerCert2 = signerCert.Substring(signerCert.Length / 2);
            object headerObject;

            if (string.IsNullOrEmpty(IntermediateCaPath))
            {
                headerObject = new
                {
                    signercert = new string[] { signerCert1, signerCert2 }
                };
            }
            else
            {
                var intermediatecacert  = CertificateUtil.GetBase64CertContent(IntermediateCaPath);
                var intermediatecacert1 = intermediatecacert.Substring(0, intermediatecacert.Length / 2);
                var intermediatecacert2 = intermediatecacert.Substring(intermediatecacert.Length / 2);
                headerObject = new
                {
                    signercert         = new string[] { signerCert1, signerCert2 },
                    intermediatecacert = new string[] { intermediatecacert1, intermediatecacert2 },
                };
            }

            return(JObject.FromObject(headerObject));
        }
コード例 #2
0
        static JObject GetIntegrityHeader(string SignerCertPath)
        {
            var    signerCert   = CertificateUtil.GetBase64CertContent(SignerCertPath);
            var    signerCert1  = signerCert.Substring(0, signerCert.Length / 2);
            var    signerCert2  = signerCert.Substring(signerCert.Length / 2);
            object headerObject = new
            {
                version = ManifestVersion,
                cert1   = signerCert1,
                cert2   = signerCert2
            };

            return(JObject.FromObject(headerObject));
        }