Hi,
I'm having a wee bit of a problem with .NET within C/AL and canonicalization of XML, RSACrypto contains a Private key. Getting the following message, see crashed here in code below: -
Best Regards
Roddy
Regards
Roddy
I'm having a wee bit of a problem with .NET within C/AL and canonicalization of XML, RSACrypto contains a Private key. Getting the following message, see crashed here in code below: -
Best Regards
Roddy
Canonicalize(IStream : InStream;VAR RSACrypto : DotNet "System.Security.Cryptography.RSACryptoServiceProvider") DigestValue : Text[250]
CanonicalizeMethod := CanonicalizeMethod.XmlDsigExcC14NTransform;
XmlDoc := XmlDoc.XmlDocument;
XmlDoc.Load(IStream);
SignedXML := SignedXML.SignedXml(XmlDoc);
//RSACrypto := RSACrypto.RSACryptoServiceProvider;
SignedInfo := SignedXML.SignedInfo;
SignedInfo.CanonicalizationMethod := XmlDsigExcC14NTransformUrl;
CanonicalizeMethod.InclusiveNamespacesPrefixList := 'Sign';
Reference := Reference.Reference;
Reference.Uri := '';
EnvTransform := EnvTransform.XmlDsigEnvelopedSignatureTransform;
Reference.AddTransform(EnvTransform);
SignedXML.AddReference(Reference);
RSAKeyValue := RSAKeyValue.RSAKeyValue(RSACrypto);
KeyInfo := KeyInfo.KeyInfo;
KeyInfo.AddClause(RSAKeyValue);
SignedXML.KeyInfo := KeyInfo;
SignedXML.ComputeSignature; // <<<<< Crashes Here
xmlDigitalSignature := SignedXML.GetXml;
Regards
Roddy