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;
Answers
Thanks