private void ValidateParameters()
        {
            string empty;
            AddAzureCertificateCommand addAzureCertificateCommand = this;

            if (this.Password == null)
            {
                empty = string.Empty;
            }
            else
            {
                empty = this.Password;
            }
            addAzureCertificateCommand.Password = empty;
        }
        internal void AddCertificateProcess()
        {
            Action <string> action = null;

            this.ValidateParameters();
            byte[]          certificateData = this.GetCertificateData();
            CertificateFile certificateFile = new CertificateFile();

            certificateFile.Data              = Convert.ToBase64String(certificateData);
            certificateFile.Password          = this.Password;
            certificateFile.CertificateFormat = "pfx";
            CertificateFile certificateFile1 = certificateFile;

            using (OperationContextScope operationContextScope = new OperationContextScope((IContextChannel)base.Channel))
            {
                try
                {
                    AddAzureCertificateCommand addAzureCertificateCommand = this;
                    if (action == null)
                    {
                        action = (string s) => base.Channel.AddCertificates(s, this.ServiceName, certificateFile1);
                    }
                    ((CmdletBase <IServiceManagement>)addAzureCertificateCommand).RetryCall(action);
                    Operation operation = base.WaitForOperation(base.CommandRuntime.ToString());
                    ManagementOperationContext managementOperationContext = new ManagementOperationContext();
                    managementOperationContext.set_OperationDescription(base.CommandRuntime.ToString());
                    managementOperationContext.set_OperationId(operation.OperationTrackingId);
                    managementOperationContext.set_OperationStatus(operation.Status);
                    ManagementOperationContext managementOperationContext1 = managementOperationContext;
                    base.WriteObject(managementOperationContext1, true);
                }
                catch (CommunicationException communicationException1)
                {
                    CommunicationException communicationException = communicationException1;
                    this.WriteErrorDetails(communicationException);
                }
            }
        }