Click here to Skip to main content
12,892,469 members (49,088 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.5

I have few Word and Excel files. Some of them are digitally signed. How do i programatically find whether the file has any digital signature ?

I referred to a code base mentioned in MSDN and other forums (converting the msdn code to .NET). But it didn't worked for me.

Can anyone suggest how to acheive this ?

I used XML approach for Digitally signing the documents.

Thanks in Advance
Posted 5-Oct-11 8:31am
YKK Reddy1.9K
SAKryukov 5-Oct-11 14:35pm
Good question, my 5.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

YKK Reddy 5-Oct-11 15:11pm

Can you post a sample code. I have tried to use it but i somehow failed.
YKK Reddy 5-Oct-11 15:17pm

i have tried ur solution. It works fine except that there is a slight modification.

After making a call _Document.Signatures, the return value we get contains a flag "CanAddSignatureLine".
If it is true, the document is not digitally signed and vice-versa.

Thanks a ton man.
Espen Harlinn 5-Oct-11 15:22pm
SAKryukov 5-Oct-11 15:47pm
Sorry, I don't have any time for a code sample in this field right now, hard to say when I can get it.
Could you try yourself more accurately and explain the problems?
SAKryukov 5-Oct-11 15:48pm
Oh, great, no experimenting anymore, thanks for reporting it back! Good point, by the way, good to know.
So, it looks like the issue is resolved, right?

You're welcome,
Good luck, call again.
SAKryukov 5-Oct-11 15:48pm
Thank you, Espen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 5 Oct 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100