Quantcast
Channel: NAV Three Tier — mibuso.com
Viewing all articles
Browse latest Browse all 10032

Canonicalization of XML

$
0
0
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: -

cfvrw6qvw7p4.png

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

Viewing all articles
Browse latest Browse all 10032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>