Пример #1
0
        static PDictionary CreateIndexRecord(string fileName)
        {
            var     provision    = MobileProvision.LoadFromFile(fileName);
            var     certificates = new PArray();
            var     record       = new PDictionary();
            PString identifier;

            record.Add("FileName", new PString(Path.GetFileName(fileName)));
            record.Add("LastModified", new PDate(File.GetLastWriteTimeUtc(fileName)));

            record.Add("Name", new PString(provision.Name));
            record.Add("Uuid", new PString(provision.Uuid));
            record.Add("Distribution", new PString(provision.DistributionType.ToString()));
            record.Add("CreationDate", new PDate(provision.CreationDate.ToUniversalTime()));
            record.Add("ExpirationDate", new PDate(provision.ExpirationDate.ToUniversalTime()));

            var platforms = new PArray();

            if (provision.Platforms != null)
            {
                for (int i = 0; i < provision.Platforms.Length; i++)
                {
                    platforms.Add(new PString(provision.Platforms[i].ToString()));
                }
            }
            record.Add("Platforms", platforms);

            if (provision.Entitlements.TryGetValue("com.apple.application-identifier", out identifier))
            {
                record.Add("ApplicationIdentifier", new PString(identifier.Value));
            }
            else if (provision.Entitlements.TryGetValue("application-identifier", out identifier))
            {
                record.Add("ApplicationIdentifier", new PString(identifier.Value));
            }
            else
            {
                record.Add("ApplicationIdentifier", new PString(string.Empty));
            }

            foreach (var certificate in provision.DeveloperCertificates)
            {
                var info = new PDictionary();

                info.Add("Name", new PString(Keychain.GetCertificateCommonName(certificate)));
                info.Add("Thumbprint", new PString(certificate.Thumbprint));

                certificates.Add(info);
            }

            record.Add("DeveloperCertificates", certificates);

            return(record);
        }
Пример #2
0
 public static bool IsDistribution(X509Certificate2 cert)
 {
     return(IsDistribution(Keychain.GetCertificateCommonName(cert)));
 }
 internal DeveloperCertificate(X509Certificate2 certificate)
 {
     Name       = Keychain.GetCertificateCommonName(certificate);
     Thumbprint = certificate.Thumbprint;
 }
Пример #4
0
 public static bool IsDevelopment(X509Certificate2 cert)
 {
     return(IsDevelopment(Keychain.GetCertificateCommonName(cert)));
 }