跳至页脚内容
使用 IRONSECUREDOC

PDF 签名服务器(开发者教程)

Digital signatures are among the cryptographic techniques that ensure digital documents' source, integrity, and non-replication. In most cases, it is rather quite different from conventional forms of handwritten signatures where advanced encryption techniques secure the document and verify the identity of the signer. Applied to a PDF, a digital signature creates an electronic "seal," which looks like a certificate identifying a document as unaltered since it was signed. This seal details an encryption system bearing a mathematical algorithm that encodes signature data onto the document. Digital signatures allow for an immutable log of changes to be kept with the document, besides identifying the signing party. In this article, we are going to create a PDF Signer server with the help of IronSecureDoc.

How to Use the PDF Signer Server

  1. Install the IronSecureDoc docker image.
  2. Run the docker image with a specific port and license key.
  3. Initialize IronSecureDoc Client with a .NET application.
  4. Get the URL and pass it into the IronSecureDoc Client while creating the object.
  5. Pass the required parameter into the IronSecureDoc Client API.
  6. Get the processed PDF documents and save them into the location.

What is IronSecureDoc?

IronSoftware's IronSecureDoc is the omnipotent solution for document security. This would protect against leakage of sensitive information through various formats of documents. It supports state-of-the-art encryption methods to secure documents from unauthorized access so that only readers or editors designated have the mandate to view or modify them. It also supports digital signatures, identifying a document maker as authorized and ensuring that its content is not tampered with since signing.

IronSecureDoc

Besides, it provides secure document sharing and maintenance with control over how they are circulated and whom it is shared with. IronSecureDoc embeds these features to help organizations and individuals maintain compliance with data protection and prevent data breaches. The relevance of this very user-friendly interface, with a set of security features, makes it very relevant software to any business willing to offer a higher level of security when sharing documents.

Features of IronSecureDoc

IronSecureDoc is provided with a plethora of features to enhance the security of the documents and keep them intact. Some of its key features include:

Advanced Encryption: This feature helps to protect documents against unauthorized eyeballs, therefore securing information secrecy through tough and strong algorithms of encryption.

Digital Signatures: This property testifies to the fact that digital signatures may be attached to any document for assertions that it is original and not altered since signing, but also who has signed it.

Safe Sharing: Share documents safely and specify persons authorized to view and even engage with them. It detects unauthorized changes or tampering to a document and therefore helps safeguard the integrity of the document.

Compliance: This brings organizations into compliance with numerous regulations on protection and industry standards by assuring the safe handling and transmission of documents.

Ease of Use: It provides easy access through its user-friendly interface in handling security features and document settings.

Audit Trails: It creates trails of history for access and modification, hence allowing transparency and accountability.

Install IronSecureDoc Docker Image

Installing and running an IronSecureDoc Docker image is easy. Here's how you might do it:

Install Docker

First of all, make sure Docker is installed on your system. You can download Docker from Docker's official website and follow the installation instructions there for your operating system.

Pull the IronSecureDoc Docker Image

Open a terminal or a Command Prompt and execute this command to pull the IronSecureDoc Docker image from the repository.

docker pull ironsoftwareofficial/ironsecuredoc
docker pull ironsoftwareofficial/ironsecuredoc
SHELL

Run the Docker Container

After the image has been pulled, the below command should start a new container. You can customize the -p flag for port mapping or the --rm used to remove one or more running Docker containers from the Docker host.

docker container run --rm -p 8080:8080 -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> -e ENVIRONMENT=Development -e HTTP_PORTS=8080 ironsoftwareofficial/ironsecuredoc:latest
docker container run --rm -p 8080:8080 -e IronSecureDoc_LicenseKey=<IRONSECUREDOC_LICENSE_KEY> -e ENVIRONMENT=Development -e HTTP_PORTS=8080 ironsoftwareofficial/ironsecuredoc:latest
SHELL

In the example above, map the host's port 8080 to the container's and assign a name to the created container in IronSecureDoc. Once the command is executed, it will display as below.

Run Docker Container

Once they start to run, you can access the list of APIs provided by the IronSecureDoc through the browser (http://localhost:8080/swagger/index.html) or any application connectivity.

Swagger

Create a New Visual Studio Project

Visual Studio makes it very widely and easily possible to develop console projects. Below are a few simple steps to help you get started on a Console Application in the environment of Visual Studio.

Before you can use Visual Studio, be sure you have installed it on your computer.

Start a New Project:

After choosing File, Project, select the New menu.

Console App

Please select "Console App" or "Console App (.NET Core)" from the list of available project template references below.

To give your project a name, fill out the "Name" field.

Project Configuration

Select the location for your project.

Click "Create" to open the Console Application project.

Target Framework

What is IronSoftware.SecureDoc.Client?

IronSoftware.SecureDoc.Client Library is easy integration into your existing .NET applications to leverage what IronSecureDoc has to offer in PDF encryption, redaction, and digital signing through easy REST API calls. Developers can easily secure documents in their applications with integrity guaranteed using IronSoftware.SecureDoc.Client library, all operations are kept on-site for high protection of data. Whether it be for redacting sensitive information, certifying document signing, or enforcing document encryption, IronSoftware.SecureDoc.Client has the tools to do all these tasks efficiently and securely.

Install IronSoftware.SecureDoc.Client

First, run the installation of the IronSoftware.SecureDoc.Client library since the upcoming patch depends on it. Finally, to complete this, open the NuGet Package Manager Console and execute the following command:

Install-Package IronSoftware.SecureDoc.Client

Install IronSoftware.SecureDoc.Client

You can also search for the package "IronSoftware.SecureDoc.Client" in the NuGet Package Manager. Choose from the list of all NuGet packages related to IronSoftware.SecureDoc.Client which one has to be downloaded.

NuGet Package Manager

Create a self-signed digital ID

Sensitive business transactions typically will ask for an ID from a certificate authority, not a self-signed one.

In Adobe Acrobat, click the hamburger menu (Windows) or Acrobat menu (macOS), then select Preferences.

Adobe Acrobat

In the left-hand Categories list, select Signatures. On the right, click More next to Identities & Trusted Certificates.

Signatures

On the left, select Digital IDs, then click the Add ID button.

Add ID

Add a new digital ID

Now select the radio button option "A new digital ID I want to create now" and then click Next.

New Digital ID

Create a new digital ID

Point where to save the digital ID and then click Next.

Save Digital ID

New PKCS#12 Digital ID File

Save Digital ID information in a .pfx file in Windows and .p12 in macOS. You can transport these files across operating systems and use them with Acrobat. If you copy a document to another operating system, Acrobat will continue using it.

Save the digital ID to a common store where other Windows applications can also access it.

Add Digital ID

PKCS-digital-id

In the field for your digital ID, type your name, email address, and other personal information; this is what will display inside the Signature box and inside the Signatures panel when you Sign or Certify a document.

Do the following: Select an item from the Key Algorithm drop-down list. From a security standpoint, a 2048-bit RSA is more secure than a 1024-bit RSA. But 1024-bit RSA is more compatible with more devices.

In the Use digital ID For menu, you can specify whether to use the digital ID for either Encryption, Digital Signature, or both.

Click Next.

Save Digital ID

Enter your identity information

Type a password for the digital ID file. As you type, the password strength meter assesses your password and displays the password strength with color patterns. Confirm your password.

The default location indicated in the File Name box will be where the digital ID file is kept. Click Browse and choose a different place to save to. Select "Finish."

Enter a password for your ID.

If a digital ID file shares the same name, you will be asked to replace it. Click OK to replace, or click Browse and select a different location to store the file.

Now an ID has been created. You can export the certificate file to send to contacts so they can use it in order to verify your signature.

Trusted Certificate

Sign a PDF Document with IronSecureDoc

Below is the sample code that will help us digitally sign the PDF document with the certificate file.

using IronSecureDoc;

Console.WriteLine("File Process started");

// Initialize the IronSecureDocClient with the URL of the locally hosted service
var client = new IronSecureDocClient("http://localhost:8080");

// Asynchronously attempt to connect to the IronSecureDoc service
if (await client.TryConnectAsync())
{
    // If connection is successful, certify the PDF document using the provided certificate
    var result = await client.CertifyAsync("Demo.pdf", "DemoSign.pfx", "Your certificate password here");

    // Save the signed PDF document to a new file
    File.WriteAllBytes("certify.pdf", result);
}

Console.WriteLine("File Process completed");

// Wait for user input before closing the console window, allowing the user to see the completion message
Console.ReadKey();
using IronSecureDoc;

Console.WriteLine("File Process started");

// Initialize the IronSecureDocClient with the URL of the locally hosted service
var client = new IronSecureDocClient("http://localhost:8080");

// Asynchronously attempt to connect to the IronSecureDoc service
if (await client.TryConnectAsync())
{
    // If connection is successful, certify the PDF document using the provided certificate
    var result = await client.CertifyAsync("Demo.pdf", "DemoSign.pfx", "Your certificate password here");

    // Save the signed PDF document to a new file
    File.WriteAllBytes("certify.pdf", result);
}

Console.WriteLine("File Process completed");

// Wait for user input before closing the console window, allowing the user to see the completion message
Console.ReadKey();
Imports IronSecureDoc

Console.WriteLine("File Process started")

' Initialize the IronSecureDocClient with the URL of the locally hosted service
Dim client = New IronSecureDocClient("http://localhost:8080")

' Asynchronously attempt to connect to the IronSecureDoc service
If Await client.TryConnectAsync() Then
	' If connection is successful, certify the PDF document using the provided certificate
	Dim result = Await client.CertifyAsync("Demo.pdf", "DemoSign.pfx", "Your certificate password here")

	' Save the signed PDF document to a new file
	File.WriteAllBytes("certify.pdf", result)
End If

Console.WriteLine("File Process completed")

' Wait for user input before closing the console window, allowing the user to see the completion message
Console.ReadKey()
$vbLabelText   $csharpLabel

The following code will first send a message to the console stating that it has begun processing files. Confirmed after that will be the creation of an IronSecureDocClient using the URL for a locally hosted IronSecureDoc service. Below is the sample PDF file.

PDF Input

This function will next proceed to asynchronously attempt to connect to the service. Assuming everything connects properly, it will call CertifyAsync to actually sign the PDF document, passing the paths of the PDF file, the PDF signature certificate file, and the certificate password. The results of that represented as a byte array of the signed PDF, will then be saved in a new file called certify.pdf.

Console Output

This finally prints in the console that the file actually has been processed successfully, then it waits for the user's input before it closes the Console window. This holds up a console window to show the completion message to the user before the application exits.

PDF Output

In the above processed file, the PDF document has been signed by the digital certificate.

Conclusion

IronSecureDoc is an integrated digital document security solution that ensures the tightest level of protection due to robust encryption and certification abilities. The IronSecureDoc client library allows users to easily add a digital signature to their documents for integrity and security standards. It has a simple API, making it easier to protect sensitive information inside documents.

Thus, it's helpful for developers who want to provide advanced protection of documents in their web server applications. Be it for legal, financial, or even business purposes, IronSecureDoc is there to help by providing appropriate tools for data protection, authentication, and end-to-end tamper-evidence across documents' entire lifecycle. IronSecureDoc offers a free trial. To know more about the pricing, refer to the pricing page. Iron Software has a multiplicity of libraries, hence making the development of applications for many platforms and operating systems easier, such as Windows, Android, MAC, and Linux, among many others.

常见问题解答

我如何创建一个PDF签名服务器?

您可以使用IronSecureDoc创建PDF签名服务器。首先安装IronSecureDoc的Docker镜像并运行一个容器来设置服务器。使用IronSecureDoc客户端来处理和应用PDF文档的数字签名。

使用IronSecureDoc部署PDF签名服务器需要哪些步骤?

部署PDF签名服务器涉及安装IronSecureDoc的Docker镜像、初始化IronSecureDoc客户端,并使用它对PDF文档应用数字签名。这确保了文档的真实性和完整性。

我如何在PDF文档中添加数字签名?

要在PDF文档中添加数字签名,请使用IronSecureDoc客户端。用服务URL初始化客户端,然后连接到服务并使用CertifyAsync方法。提供PDF文件的路径、签名证书和证书密码。

使用IronSecureDoc进行数字签名的优势是什么?

IronSecureDoc提供先进的加密技术和数字签名,以确保文档的完整性和真实性。它提供安全的文档共享、符合数据保护法规,并且界面友好,非常适合需要高安全性的企业。

IronSecureDoc能帮助实现文档安全合规吗?

是的,IronSecureDoc通过提供安全的文档处理和传输来帮助实现数据保护法规的合规性,帮助组织达到行业标准并防止数据泄露。

安装IronSecureDoc Docker镜像的过程是什么?

要安装IronSecureDoc的Docker镜像,请确保Docker已经安装在您的系统上,然后执行命令docker pull ironsoftwareofficial/ironsecuredoc从仓库中拉取镜像。

我如何创建用于签署PDF文档的自签名数字ID?

您可以使用Adobe Acrobat创建自签名数字ID,通过导航到首选项 > 签名 > 身份和信任证书旁边的 更多。选择数字ID,点击添加ID,并按照提示创建一个新的数字ID,格式为.pfx或.p12文件。

是什么使IronSecureDoc适合处理商业和法律文档?

IronSecureDoc适合处理商业和法律文档,因为它提供了强大的加密、数字签名、审计跟踪和用户友好界面。它确保防止未经授权的访问并维护文档的完整性。

我在哪里可以了解更多关于IronSecureDoc的定价信息?

您可以访问他们的定价页面https://ironsoftware.com/enterprise/securedoc/licensing/来了解更多关于IronSecureDoc的定价信息。他们提供免费试用和不同定价选项的详细信息。

数字签名在文档安全中扮演什么角色?

数字签名在文档安全中起着至关重要的作用,提供一个加密印章,用于验证签名者的身份,并确保文档自签署后未被篡改,从而保持其完整性和真实性。

Curtis Chau
技术作家

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

除了开发之外,Curtis 对物联网 (IoT) 有浓厚的兴趣,探索将硬件和软件集成的新方法。在空闲时间,他喜欢玩游戏和构建 Discord 机器人,将他对技术的热爱与创造力相结合。