We are encountering an issue with the SDK when signing an XML file. Using the .net SDK ( v3.3.5) , the XML is signed and validated successfully through simulation CLI. However, when we attempt to sign the same XML using the C# SDK with .NET 4.8, we encounter the following error when we invoke the function “signer.SignDocument(xmlDoc, certificate, privateKey);”:
im using the private key which is generated along with CSR. and i copy paste in the destination “ec-secp256k1-priv-key.pem” accordingly mentioned in guidelines.
Problem creating EC private key: System.NullReferenceException: Object reference not set to an instance of an object.
at Org.BouncyCastle.Security.PrivateKeyFactory.CreateKey(PrivateKeyInfo keyInfo) in /_/crypto/src/security/PrivateKeyFactory.cs:line 110
at Org.BouncyCastle.OpenSsl.PemReader.ReadPrivateKey(PemObject pemObject) in /_/crypto/src/openssl/PEMReader.cs:line 321
code :
Could you please provide assistance or guidance on how to resolve this issue?
We appreciate your support and look forward to your response.