Stuart is an Avid Commentator
33 published comments for 2022
User bio
How long is a piece of string? WRITE $LENGTH($P(STRING,DELIMITER,2)) ; simples!
Member since May 6, 2021
Replies:

I had to do something like this a few years ago to add a digital signature to a message in XML format. If I remember correctly you have to get your object into a %XML.Document which works in conjunction with %XML.Node. %XML.Node is used to traverse the %XML.Document to get to the section you want in canonical form. Then you pass the Node to ##class(%XML.Writer).Canonicalize(Node) to get the XML as a string which is then passed to the encryption function you use to get your digest/signature. You can pass the whole document or just a subsection to the canonicalize function.

I can't say if it's the only or best way to do it but it was sufficiently quick enough to handle thousands of messages per minute.

Discourage the use of hard coded breaks in the first place! There are alternatives.

  • Use ZBREAK Tag+OffSet^Routine to set a break point just for the current process
  • Use the debugger in Cache´ Studio (under the Debug menu and attach to a process)
  • George James has a decent debugger in Serenjii
  • Put something in your processes to remove hard coded break points when you promote code through the development cycle (you can automate this if you try)

I've seen some places where the ^ROUTINE global is fully or partially deleted after compilation. I suspect that the same would work for ^rMAC or ^oddDEF - you'd have to test it. One company that I'm aware of encrypts the ^ROUTINE global after compilation which has the added "benefit" of making it extra difficult to debug errors! If you really want to hide your code you could compile the code on an identical system and then just deploy the object code.

Followers:
Stuart has no followers yet.
Following:
Stuart has not followed anybody yet.
Global Masters badges:
Stuart has no Global Masters badges yet.