以编程方式将图像添加到数字签名

以编程方式将图像添加到数字签名

问题描述:



我需要使用C#以编程方式对文档(Word/Excel)进行数字签名.
我在互联网上发现了几则帖子,向我展示了如何添加数字签名.

默认情况下,我为此目的使用Microsoft Office签名功能.
现在,我想以编程方式将图像嵌入此数字签名并将其放置在文件的末尾.

谁能帮我吗?

请注意,如果我们尝试在Word/Excel文件中添加数字签名,它会要求我们选择图像.我需要以编程方式进行

在此先感谢

Hi,

I need to digitally sign a document (Word/Excel) programatically using C#.
I found few posts on internet showing me how to just add a digital signature.

By default, i am using Microsoft Office Signing capabilities for this purpose.
Now, i want to embed an image to this Digital Signature Programatically and place it at the end of the file.

Can anyone help me?

Please note that if we try to add Digital Signature in Word/Excel file it asks us to select an image. I need to do that programatically

Thanks in Advance

我用Google对其进行了搜索,并询问了许多专家.他们提出了不同的解决方案,这些解决方案被证明是昂贵的(性能受到阻碍).

因此,我已经使用Interop程序集在单词文档的末尾添加了图像,然后应用了数字签名(使用开放XML)方法.

尽管word/Excel允许在进行数字签名时选择图像,但要实现这一点非常困难.

因此,功能分为两部分.
1.添加图像文件.
2.添加数字签名
I googled it and asked many experts. They came out with different solutions which proved to be costly (performance was getting hampered).

So i have added image at the end of the word document using Interop assemblies and then applied Digital Signature (using open XML) approach.

Although word/Excel allows choosing an image while digitally signing, it is quite difficult to acheive this.

So, the functionality is broken into 2 parts.
1. Add Image file.
2. Add digital Signature