Link to home
Start Free TrialLog in
Avatar of Yurij_Jilov
Yurij_Jilov

asked on

verifying sign using S/MIME signed-data

Hi,all! I need help anybody familiar with S/MIME format. In my current project I must verify e-mail message sign.My signed message  look like:

..............................whole message title........................


------------3B1811451B00BA09
Content-Type: text/plain; charset=Windows-1251
Content-Transfer-Encoding: 8bit

test

................................followed smime.p7s attachment section.........

Sign is verified by MS CryptoAPI function CryptVerifyDetachedMessageSignature.
My question is what is message part signed, any words, what signed message boundaries, is signed message "test",
"

test

", or
"
------------3B1811451B00BA09
Content-Type: text/plain; charset=Windows-1251
Content-Transfer-Encoding: 8bit

test

" ? Any help appreciate.
Avatar of qwaletee
qwaletee

This is using LotusScript?

You would probably want to extra the full message content as a single on-disk file, and run the MS API against it.  You will need to use the DEFINE statement in LotusScript (Definitions) section to create a header for calling the MS functions, and you will have to fiddle with getting the parameters to match variables that you can pass and retrieve properly.

The way to extract the MIME is to use either Notes API calls in a similar way to calling the MS API.  Or, you can use the Notes LotusScript API to extract MIME sections as text variables, and write them to disk.  How you do that will depend on whether your code runs in R6 or R5.
Avatar of Yurij_Jilov

ASKER

OK! My problem is not to extract MIME content from document ( i am using NSF_HOOKS to intercept  notes client actions to open/update document). I need know what message part was signed by sending mail agent to verify sign. I have whole MIME content and attached smime.p7s file (sign+certificate), on Windows i can use CryptoAPI to verify sign, in particular CryptVerifyDetachedMessageSignature to carry out this service. To use one i need know signed block of MIME. On sending message contained "test" word, but attempting to verify "test" only get result "Invalid signature", apparently signed block contains more info than just "test". I am not assured my question for this forum, just S/MIME word more meets on this forum :-)))))
That's a tough one.  I don't know how a Domino-stored S/MIME message woudl look different than i any other system.  I guess you could send the signed message to an INternet account and a Notes account, and see if there is any difference between your extracted MIEM and the Internet mailbox message source.  If there is no difference, tnen you are oding something wrong.  If there is a difference, and you can see how to reconcile that diofference, you will have solved your problem.
Problem was solved.In my case was signed this block:
//-----------------------------------
Content-Type: text/plain; charset=Windows-1251
Content-Transfer-Encoding: 8bit

test
//------------------------------------------

if must to sign multyple/mixed type block then signed block look like:
//---------------------------------------
Content-Type: multyple/mixed;boundary = "xyz"
...........block content...........................
----xyz--
//---------------------------------------

How I can close question?
I am having problems in verifying the signed mail, I am not what parameter need to send to the method 'CryptVerifyDetachedMessageSignature' can you please explain?
I have one more doubt, if there is an attachment which content we need to send?

do we need to send both message and attachment content as the parameter?
do we need to encode it?

From the mime content, I have smime.p7s file, and I am sending just message with out mime content and I am getting the error 'Hash value not correct'

please explain it.

Thank you.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    PAQ with points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

marilyng
EE Cleanup Volunteer
ASKER CERTIFIED SOLUTION
Avatar of DarthMod
DarthMod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial