Esempio n. 1
0
        /// <summary>
        /// 创建数字证书签名
        /// </summary>
        /// <param name="userInfo">用户</param>
        /// <param name="password">密码</param>
        /// <param name="statusCode">返回状态码</param>
        /// <param name="statusMessage">返回状消息</param>
        /// <returns>私钥</returns>
        public string CreateDigitalSignature(BaseUserInfo userInfo, string password, out string statusCode, out string statusMessage)
        {
            var parameter = ServiceParameter.CreateWithMessage(userInfo
                                                               , MethodBase.GetCurrentMethod()
                                                               , this.serviceName
                                                               , AppMessage.LogOnService_CreateDigitalSignature);
            string result        = string.Empty;
            string returnCode    = string.Empty;
            string returnMessage = string.Empty;

            ServiceUtil.ProcessUserCenterWriteDb(parameter, (dbHelper) =>
            {
                var userManager = new BaseUserLogOnManager(dbHelper, userInfo);
                result          = userManager.CreateDigitalSignature(password, out returnCode);
                // 获得状态消息
                returnMessage = userManager.GetStateMessage(returnCode);
            });
            statusCode    = returnCode;
            statusMessage = returnMessage;
            return(result);
        }