Example #1
0
        private SignStrResult SignStr(SingStrIn singStrIn)
        {
            SignStrResult result = new SignStrResult();

            if (singStrIn == null)
            {
                return(result);
            }
            try
            {
                var client = new ASClient.ASClientControl();
                client.Init();
                client.Silent = false;
                var signCertificateSerialNumber = singStrIn.CertSn.Length > 0 ? singStrIn.CertSn : client.SignCertificateSerialNumber;
                if (signCertificateSerialNumber != null)
                {
                    result.StrToSign = singStrIn.StrToSign;
                    result.CertSn    = signCertificateSerialNumber;
                    result.Signature = client.SignMessageCertCodepage(singStrIn.StrToSign, signCertificateSerialNumber, 1251);
                }
            }
            catch
            {
                throw;
            }
            return(result);
        }
Example #2
0
        public SignStrOut SignString(SingStrIn singStrIn)
        {
            SignStrOut result = new SignStrOut();

            try
            {
                result.Result = SignStr(singStrIn);
                result.error  = null;
            }
            catch (Exception ex)
            {
                result.Result        = null;
                result.error.Message = ex.Message;
                result.error.Code    = 60600;
            }
            return(result);
        }
Example #3
0
        public SignStrOut SignString(SingStrIn singStrIn)
        {
            SignService sSignService = new SignService();

            return(sSignService.SignString(singStrIn));
        }