コード例 #1
0
        public string firmaNodoDD(string DD, int tipoDte, string rut)
        {
            string pk = getXmlFolio("RSA", tipoDte, rut);

            Encoding ByteConverter = Encoding.GetEncoding("ISO-8859-1");

            byte[] bytesStrDD = ByteConverter.GetBytes(DD);
            byte[] HashValue  = new SHA1CryptoServiceProvider().ComputeHash(bytesStrDD);

            RSACryptoServiceProvider rsa = FuncionesComunes.crearRsaDesdePEM(pk);

            byte[] bytesSing = rsa.SignHash(HashValue, "SHA1");

            string FRMT1 = Convert.ToBase64String(bytesSing);

            return(FRMT1);
        }