for a bank transaction implementation, I have a private key and some data and I need to sign that data with the private key.
The example code the bank has given is in C# .NET and I can't find any equivalent to it in python.
The key is in the following format :
<RSAKeyValue>
<Modulus>...</Modulus>
<Exponent>...</Exponent>
<P>...</P>
<Q>...</Q>
<DP>...</DP>
<DQ>...</DQ>
<InverseQ>...</InverseQ>
<D>...</D>
</RSAKeyValue>
And the example code is this :
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString(“ <RSAKeyValue><Modulus>oQRshGhLf2Fh... ”);
string data = "#" + merchantCode + "#" + terminalCode + "#"
+invoiceNumber + "#" + invoiceDate + "#" + amount + "#" +redirectAddress
+ "#" + action + "#" + timeStamp + "#";
byte[] signMain = rsa.SignData(Encoding.UTF8.GetBytes(data), new
SHA1CryptoServiceProvider());
sign = Convert.ToBase64String(signMain);
Now I have not found any good equivalent for this in python and I need to do the exact thing in order to not raise any exceptions. I once asked this question in another literature and it got put on hold. I don't know why they did that but I have been struggling this for weeks and I have not yet found any solutions. so please help me in any way you can. thanks in advance.