EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How to Validate ReceivedContentDigest for TElAS2Receipt

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#24185
Posted: 03/19/2013 23:13:59
by Sam Wilkinson (Basic support level)
Joined: 02/28/2013
Posts: 5

Hello,

The TElAS2Receipt has ReceivedContentDigest and ReceivedContentDigestAlgorithm.

The TElAS2Message has ContentDigest and ContentDigestAlgorithm, but after calling the TElAS2Message.Save(...) method. The ContentDigest remains as an empty byte[].

Considering there are two Digest Algorithms supported by EDIBlackBox (SHA-1 and MD5), how would I verify the ReceivedContentDigest property on an TElAS2Receipt that I receive from AS2 partners ?
Is there a class that can calculate the SHA-1 or MD5 hash of a message ?
#24186
Posted: 03/20/2013 04:00:15
by Alexander Ionov (EldoS Corp.)

Thank you for the question.

ContentDigest for a message is calculated on message load and then is copied to receipt if it's requested. Unfortunatelly there is no public way by now to calculate message digest on message saving.
But you're right, and we're going to add digest calculation on message saving if the message requests a receipt.


--
Best regards,
Alexander Ionov
#24187
Posted: 03/20/2013 04:04:10
by Alexander Ionov (EldoS Corp.)

Quote
Alexander Ionov wrote:
Unfortunatelly there is no public way by now to calculate message digest on message saving.

The only way I can imagine now, is to load the message after you save it.


--
Best regards,
Alexander Ionov
#24207
Posted: 03/20/2013 21:03:23
by Sam Wilkinson (Basic support level)
Joined: 02/28/2013
Posts: 5

Quote

But you're right, and we're going to add digest calculation on message saving if the message requests a receipt.


If I could make a suggestion/request. It would be good if this new feature of calculating the digest on/after Save(...) was sort of like:

TElAS2Message has a method called CalculateDigests(param DigestAlgorithm[] algorithms).
Which returns IEnumerable<ContentDigest>

The ContentDigest object has two properties (read only) DigestAlgorithm and DigestValue.

After TElAS2Message.Save(..) has been called then you can call CalculateDigests passing in the DigestAlgorithm(s) that you wish to be calculated for the message.
Either that, or TElAS2Message.Save(..) calculates both the MD5 and SHA-1 Digest values and the TElAS2Message exposes these (via separate properties or via an IEnumerable<ContentDigest>).
#24210
Posted: 03/21/2013 05:00:49
by Alexander Ionov (EldoS Corp.)

Thank you for your suggestion. We'll take it into account when working on this feature.


--
Best regards,
Alexander Ionov
Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages

Reply

Statistics

Topic viewed 606 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!