What does keydata do (SignatureBoxWrapper)?

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

What does keydata do (SignatureBoxWrapper)?

Post by wjstarck » Fri Mar 20, 2020 3:09 pm

What is the purpose of the keydata with regard to SignatureBoxWrapper?

If I can invalidate the signature with a changed event in a control, what purpose does it serve?
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: What does keydata do (SignatureBoxWrapper)?

Post by cmcgehee » Mon Mar 23, 2020 9:00 am

The purpose of keyData is to ensure the signature is for the data it was originally signed for. For example, if I signed an ortho chart that had fields set to "Strong", "Clean", and "Tight", but someone modified the database to change the fields to "Strong", "Clean", and "Loose", the hash of the keyData would not match the signature so the signature would display as invalid.
Chris McGehee
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: What does keydata do (SignatureBoxWrapper)?

Post by wjstarck » Wed Mar 25, 2020 2:04 pm

Thanks for that.

I had implemented SignatureBoxWrapper many years ago but that was on a form that had only one note in it, so I set the keydata to the text of that note. Now I am making a form for compliance with the new anesthesia regs in Texas and there are multiple notes on it, so I wasn't sure what to key off of. In the past I just invalidated the signature if a form had already been signed and the user changed any control by placing an InvalidateSig() call in the _Changed event for all the controls in the form, which would just clear the sig. So do I have to use the keydata property at all, or can I just do it this way?

Or, should I be creating a keydata string with the data from all the controls? If so, is there a limit to the number of characters keydata can hold?
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: What does keydata do (SignatureBoxWrapper)?

Post by cmcgehee » Wed Mar 25, 2020 3:45 pm

The best way would be to set your keyData based on each control that takes input from the form. This way your signature would also be invalidated if someone did an UPDATE statement directly on the database. I don't believe their is any limitation to the length of keyData. We use the entire proc note as keyData, and some dentists write some long notes!
Chris McGehee
Open Dental Software
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: What does keydata do (SignatureBoxWrapper)?

Post by wjstarck » Wed Mar 25, 2020 4:57 pm

Thanks Chris
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

Post Reply