Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.5
Hi,
 
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.5K
Comments
SAKryukov at 5-Oct-11 14:35pm
   
Good question, my 5. --SA

1 solution

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

Solution 1

With Word interop, use _Document.Signatires property:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document.signatures%28v=office.14%29.aspx[^].
 
Likewise, with Excel, use _Workbook.Signatures:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._workbook.signatures.aspx[^].
 
Did you try it?
 
—SA
  Permalink  
v2
Comments
YKK Reddy at 5-Oct-11 15:11pm
   
Hi, Can you post a sample code. I have tried to use it but i somehow failed.
SAKryukov at 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? --SA
YKK Reddy at 5-Oct-11 15:17pm
   
Hi, 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.
SAKryukov at 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. --SA
Espen Harlinn at 5-Oct-11 15:22pm
   
5'ed!
SAKryukov at 5-Oct-11 15:48pm
   
Thank you, Espen. --SA

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Shai Vashdi 1,518
1 Manas Bhardwaj 319
2 Tadit Dash 285
3 OriginalGriff 273
4 Peter Leow 205
0 Sergey Alexandrovich Kryukov 9,530
1 OriginalGriff 5,716
2 Peter Leow 4,345
3 Maciej Los 3,540
4 Abhinav S 3,373


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 5 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid