public IEnumerable<Certificate> GetCertificateProcess(out Operation operation) { IEnumerable<Certificate> certificates; Func<string, Certificate> func = null; Func<string, CertificateList> func1 = null; IEnumerable<Certificate> certificates1 = null; operation = null; using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel)) { try { if (this.Thumbprint == null) { GetAzureCertificateCommand getAzureCertificateCommand = this; if (func1 == null) { func1 = (string s) => base.Channel.ListCertificates(s, this.ServiceName); } certificates1 = ((CmdletBase<IServiceManagement>)getAzureCertificateCommand).RetryCall<CertificateList>(func1); } else { if (this.ThumbprintAlgorithm != null) { Certificate[] certificateArray = new Certificate[1]; Certificate[] certificateArray1 = certificateArray; int num = 0; GetAzureCertificateCommand getAzureCertificateCommand1 = this; if (func == null) { func = (string s) => base.Channel.GetCertificate(s, this.ServiceName, this.ThumbprintAlgorithm, this.Thumbprint); } certificateArray1[num] = ((CmdletBase<IServiceManagement>)getAzureCertificateCommand1).RetryCall<Certificate>(func); certificates1 = certificateArray; } else { throw new ArgumentNullException("ThumbprintAlgorithm", "You must specify the thumbprint algorithm."); } } operation = base.WaitForOperation(base.CommandRuntime.ToString()); } catch (CommunicationException communicationException1) { CommunicationException communicationException = communicationException1; if (communicationException as EndpointNotFoundException == null || base.IsVerbose()) { this.WriteErrorDetails(communicationException); } else { certificates = null; return certificates; } } return certificates1; } return certificates; }
X509Certificate2 cert = new X509Certificate2(Convert.FromBase64String(certificate.Data)); if (cert != null) { Console.WriteLine("Certificate FriendlyName:{0}", cert.FriendlyName); Console.WriteLine("Certificate Subject:{0}", cert.Subject); Console.WriteLine("Certificate Issuer:{0}", cert.Issuer); Console.WriteLine("Certificate SerialNumber:{0}", cert.SerialNumber); } Console.WriteLine("Certificate Data:{0}", certificate.Data); } } internal static void LogObject(OperatingSystemFamilyList operatingSystemFamilyList) { if (operatingSystemFamilyList == null) { return; } Console.WriteLine("OperatingSystemFamilyList contains {0} item(s).", operatingSystemFamilyList.Count); foreach (var item in operatingSystemFamilyList) { Console.WriteLine("OperatingSystemFamily Name:{0}", item.Name); Console.WriteLine("OperatingSystemFamily Label:{0}", ServiceManagementHelper.DecodeFromBase64String(item.Label)); Console.WriteLine("Operating Systems in this family:"); LogObject(item.OperatingSystems); } } internal static void LogObject(OperatingSystemList operatingSystemList) { if (operatingSystemList == null) {