Hi community,
I am building an extension in Business Central and I need to apply a HTTP signature to my API calls.
At this moment I am using the function SignData in codeunit 1266 "Cryptography Management", because I need to sign my data with algorithm sha256 and by using my private key file.
When I use this function however, I receive the following error message.
Error:
A call to System.Security.Cryptography.RSACryptoServiceProvider.FromXmlString failed with this message: Invalid syntax on line 1.
Code:
TempBlob.CreateOutStream(SignatureOutStream);
CryptographyMgt.SignData(SigningString, PrivateKeyFile, HashAlgorithmType::SHA256, SignatureOutStream);
Does anyone have an idea what could be the problem?
Thanks a lot!
Kind regards,
Gijs