Пример #1
0
        public string SignDocument(string xml)
        {
            var doc = new SignedXmlDocument(xml);

            CrytoProvider.SignDocument(doc);
            var cdata = new XCData(doc.ToString());

            return(cdata.ToString());
        }
Пример #2
0
        //public string SignXml(string xml)
        //{
        //  return xml;
        //}

        //public CDataWrapper Sign(CDataWrapper request)
        //{
        //  return new CDataWrapper() { Value = request.Value };
        //}

        public ResponseMessage SignXml(RequestMessage xml)
        {
            try
            {
                var doc = new SignedXmlDocument(xml.Xml.Value);
                CrytoProvider.SignDocument(doc);
                return(new ResponseMessage()
                {
                    Xml = doc.ToString()
                });
            }
            catch (Exception exception)
            {
                ErrorMessage += exception.Message + "\n" + exception.StackTrace;
            }
            return(new ResponseMessage {
                Xml = null, Error = ErrorMessage
            });
        }