USING IRONSECUREDOC

PDF Signer Server (Developer Tutorial)

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.

Frequently Asked Questions

What is a digital signature?

A digital signature is a cryptographic technique that ensures the authenticity, integrity, and non-repudiation of digital documents. It creates an electronic 'seal' that confirms a document has not been altered since it was signed.

How do I install the Docker image for document signing?

To install the IronSecureDoc Docker image, ensure Docker is installed on your system. Then, use the command 'docker pull ironsoftwareofficial/ironsecuredoc' to pull the image from the repository.

What are the key features of this document security solution?

IronSecureDoc offers advanced encryption, digital signatures, safe document sharing, compliance with regulations, ease of use through a user-friendly interface, and audit trails for access and modification transparency.

How can I run the Docker container for document signing?

After pulling the Docker image, run the container using the command 'docker container run --rm -p 8080:8080 -e IronSecureDoc_LicenseKey=ironsoftwareofficial/ironsecuredoc:latest'. Customize the -p flag for port mapping as needed.

What is the .NET client library for document security?

IronSoftware.SecureDoc.Client is a library that integrates with .NET applications for PDF encryption, redaction, and digital signing via REST API calls, ensuring high data protection by keeping operations on-site.

How do I create a self-signed digital ID in Adobe Acrobat?

In Adobe Acrobat, navigate to Preferences > Signatures > More next to Identities & Trusted Certificates. Select Digital IDs, click Add ID, and follow the prompts to create a new digital ID in a .pfx or .p12 file.

How do I sign a PDF document using a document security solution?

Initialize the IronSecureDocClient with the service URL, connect to the service, and use the CertifyAsync method to sign the PDF. Provide the paths to the PDF file, signature certificate file, and the certificate password.

Does this solution offer compliance with data protection regulations?

Yes, IronSecureDoc ensures compliance with data protection regulations by providing secure document handling and transmission, helping organizations meet industry standards and prevent data breaches.

What are the benefits of using this solution for document security?

IronSecureDoc provides robust document security through encryption and digital signatures, ensuring document integrity, safe sharing, regulatory compliance, and a user-friendly interface for ease of use.

Where can I find more information about pricing for this document security solution?

For detailed pricing information, visit the IronSecureDoc pricing page at https://ironsoftware.com/enterprise/securedoc/licensing/.

Chaknith Bin
Software Engineer
Chaknith works on IronXL and IronBarcode. He has deep expertise in C# and .NET, helping improve the software and support customers. His insights from user interactions contribute to better products, documentation, and overall experience.
< PREVIOUS
Docker sign PDF (Developer Tutorial

Ready to get started? Version: 2024.10 just released

View Licenses >