コード例 #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));
            }
        }
コード例 #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));
            }
        }
コード例 #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));
            }
        }
コード例 #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));
            }
        }
コード例 #5
0
 public CsdUtils(string url, string user, string password, int proxyPort = 0, string proxy = null) : base(url, user, password, proxy, proxyPort)
 {
     _handler = new CsdResponseHandler();
 }
コード例 #6
0
 public CsdUtils(string url, string token, int proxyPort = 0, string proxy = null) : base(url, token, proxy, proxyPort)
 {
     _handler = new CsdResponseHandler();
 }