Gets the Message Integrity Check (MIC) value of the message.
Syntax:
Remarks:
The MIC value is the base64-encoded digest of the message. The digest is calculated as follows:
- Preparing before sending the message:
- For unencrypted and unsigned message, the digest is calculated over the body of the message only. That is, only the content, not including the headers of the message.
- For signed message to be sent, the message must be canonicalized first and then the digest is calculated over the message (header and content) before securing the message.
- For encrypted and unsigned message to be sent, the message must be canonicalized first and then the digest is calculated over the message (header and content) before securing the message.
- Receiving and processing the message:
- When a message is received, the MIC is calculated after the last signing and encrypting operation, and final canonicalization is done on message.
The algorithm used to calculate the MIC value is stored in the MicAlgorithm property.
Example:
Dim oMailDocument As Fredi.mailDocument
Dim oSubjMsg As Fredi.mailMessage
Dim sMicValue As String
Set oMailDocument = oEdiDoc.GetMailDocument
Set oSubjMsg = oMailDocument.GetMessage
' Configure the security of this message.
' Specify the signing algorithm to use for MIC calculation
Dim oSecurity As Fredi.ediSecurity
Set oSecurity = oSubjMsg.GetSecurity
oSecurity.AssuranceAlgorithm = "sha1"
oSubjMsg.Import(sPath)
oSubjMsg.HeaderFieldValue("AS2-Version") = "1.0"
oSubjMsg.HeaderFieldValue("AS2-To") = "abc@example.com"
oSubjMsg.HeaderFieldValue("AS2-From") = "myMail@example.com"
' Encode the message to base 64
oSubjMsg.EncodingBase64 = True
' Request that an MDN be returned
oSubjMsg.RequestSignedMDN()
' Capture MIC value
sMicValue = oSubjMsg.MicValue