Example #1
0
        internal override CsdResponse DisableCsd(string certificateNumber)
        {
            CsdResponseHandler handler = new CsdResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                HttpWebRequest request = this.RequestDisableCsd(certificateNumber);
                return(handler.GetResponse(request));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Example #2
0
        internal override CsdResponse DisableCsd(string certificateNumber)
        {
            CsdResponseHandler handler = new CsdResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                var headers = GetHeaders();
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                return(handler.GetDeleteResponse(Url, headers,
                                                 "certificates/" + certificateNumber, proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Example #3
0
        internal override CsdResponse UploadCsd(string cer, string key, string password, string certificateType, bool isActive)
        {
            CsdResponseHandler handler = new CsdResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                if (String.IsNullOrEmpty(cer) || String.IsNullOrEmpty(key))
                {
                    throw new ServicesException("El certificado o llave privada vienen vacios");
                }
                HttpWebRequest request = this.RequestUploadCsd(cer, key, password, certificateType, isActive);
                return(handler.GetResponse(request));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Example #4
0
        internal override CsdResponse UploadCsd(string cer, string key, string password, string certificateType, bool isActive)
        {
            CsdResponseHandler handler = new CsdResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                if (String.IsNullOrEmpty(cer) || String.IsNullOrEmpty(key))
                {
                    throw new ServicesException("El certificado o llave privada vienen vacios");
                }
                var headers = GetHeaders();
                var content = RequestCsd(cer, key, password, certificateType, isActive);
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                return(handler.GetPostResponse(Url,
                                               "certificates/save", headers, content, proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }