Good afternoon, I am in the process of changing from cfdi 3.2 to 3.3.
Once the original string was generated, reading in other posts I found a validator of it and it is correct, at the time of generating the stamp with SHA 256, it shows me an error.
"Uncontrolled exception of type 'System.Cryptography.CryptographicException' Additional Information: 'Algorithm specified is not valid' "
Since I was able to verify that the original string is correct I copy the part where I try to generate the stamp.
string co = generarCadenaOriginal(oCFDi);
X509Certificate2 _MiCertificado = new X509Certificate2(@"" + rutaP12, @"" + ConfigurationManager.AppSettings["PublicKey"], X509KeyStorageFlags.MachineKeySet);
RSACryptoServiceProvider RSA1 = (RSACryptoServiceProvider)_MiCertificado.PrivateKey;
UTF8Encoding eUTF = new UTF8Encoding(true);
byte[] tester = eUTF.GetBytes(co);
SHA256CryptoServiceProvider hasher = new SHA256CryptoServiceProvider();
byte[] signedBytes = RSA1.SignData(tester, hasher);
return Convert.ToBase64String(signedBytes);
I appreciate you can help me, Greetings to all