PDF Signer Server (samouczek dla programistów)
Podpisy cyfrowe należą do technik kryptograficznych, które zapewniają pochodzenie, integralność i niepowtarzalność dokumentów cyfrowych. W większości przypadków różni się to znacznie od konwencjonalnych form podpisów odręcznych, gdzie zaawansowane techniki szyfrowania zabezpieczają dokument i weryfikują tożsamość podpisującego. Zastosowany do pliku PDF podpis cyfrowy tworzy elektroniczną "pieczęć", która wygląda jak certyfikat potwierdzający, że dokument nie został zmieniony od momentu podpisania. Ta pieczęć opisuje system szyfrowania oparty na algorytmie matematycznym, który koduje dane podpisu w dokumencie. Podpisy cyfrowe pozwalają na prowadzenie niezmiennego rejestru zmian w dokumencie, a także na identyfikację strony podpisującej. W tym artykułe stworzymy serwer PDF Signer przy pomocy IronSecureDoc.
Jak korzystać z serwera PDF Signer
- Zainstaluj obraz Docker IronSecureDoc.
- Uruchom obraz Docker z określonym portem i kluczem licencyjnym.
- Zainicjuj klienta IronSecureDoc za pomocą aplikacji .NET.
- Pobierz adres URL i przekaż go do klienta IronSecureDoc podczas tworzenia obiektu.
- Przekaż wymagańy parametr do interfejsu API klienta IronSecureDoc.
- Pobierz przetworzone dokumenty PDF i zapisz je w wybranej lokalizacji.
Czym jest IronSecureDoc?
IronSecureDoc firmy Iron Software to wszechstronne rozwiązanie zapewniające bezpieczeństwo dokumentów. Zapobiegnie to wyciekowi poufnych informacji w różnych formatach dokumentów. Obsługuje najnowocześniejsze metody szyfrowania w celu zabezpieczenia dokumentów przed nieautoryzowanym dostępem, tak aby tylko wyznaczeni czytelnicy lub redaktorzy mieli uprawnienia do ich przeglądania lub modyfikowania. Obsługuje również podpisy cyfrowe, identyfikując twórcę dokumentu jako upoważnionego i zapewniając, że jego treść nie została zmieniona od momentu podpisania.

Ponadto zapewnia bezpieczne udostępnianie i zarządzanie dokumentami, umożliwiając kontrolę nad sposobem ich rozpowszechniania oraz osobami, którym są udostępniane. IronSecureDoc wykorzystuje te funkcje, aby pomóc organizacjom i osobom fizycznym zachować zgodność z przepisami dotyczącymi ochrony danych i zapobiegać naruszeniom bezpieczeństwa danych. Dzięki bardzo przyjaznemu interfejsowi i zestawowi funkcji bezpieczeństwa oprogramowanie to jest idealnym rozwiązaniem dla każdej firmy, która chce zapewnić wyższy poziom bezpieczeństwa podczas udostępniania dokumentów.
Funkcje IronSecureDoc
IronSecureDoc oferuje mnóstwo funkcji zwiększających bezpieczeństwo dokumentów i zapewniających ich nienaruszalność. Niektóre z jego kluczowych funkcji to:
Zaawansowane szyfrowanie: Ta funkcja pomaga chronić dokumenty przed nieuprawnionym dostępem, zapewniając w ten sposób poufność informacji dzięki solidnym i silnym algorytmom szyfrowania.
Podpisy cyfrowe: Ta właściwość potwierdza, że podpisy cyfrowe mogą być dołączane do dowolnego dokumentu w celu potwierdzenia, że jest on oryginalny i nie został zmieniony od momentu podpisania, a także w celu wskazania, kto go podpisał.
Bezpieczne udostępnianie: bezpiecznie udostępniaj dokumenty i określ osoby uprawnione do ich przeglądania, a nawet edytowania. Wykrywa nieautoryzowane zmiany lub manipulacje w dokumencie, a tym samym pomaga chronić jego integralność.
Zgodność z przepisami: Dzięki temu organizacje mogą zachować zgodność z licznymi przepisami dotyczącymi ochrony danych i standardami branżowymi, zapewniając bezpieczne przetwarzanie i przesyłanie dokumentów.
Łatwość użytkowania: Dzięki przyjaznemu dla użytkownika interfejsowi zapewnia łatwy dostęp do funkcji bezpieczeństwa i ustawień dokumentów.
Ścieżki audytu: Tworzy ścieżki historii dostępu i modyfikacji, zapewniając w ten sposób przejrzystość i rozliczalność.
Zainstaluj obraz Docker IronSecureDoc
Instalacja i uruchomienie obrazu Docker IronSecureDoc jest łatwe. Oto jak można to zrobić:
Zainstaluj Docker
Przede wszystkim upewnij się, że Docker jest zainstalowany w Twoim systemie. Możesz pobrać Docker z oficjalnej strony Docker i postępować zgodnie z instrukcjami instalacji dla swojego systemu operacyjnego.
Pobierz obraz Docker IronSecureDoc
Otwórz terminal lub wiersz poleceń i wykonaj to polecenie, aby pobrać obraz Docker IronSecureDoc z repozytorium.
docker pull ironsoftwareofficial/ironsecuredoc
docker pull ironsoftwareofficial/ironsecuredoc
Uruchom kontener Docker
Po pobraniu obrazu poniższe polecenie powinno uruchomić nowy kontener. 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
W powyższym przykładzie należy zmapować port 8080 hosta na port kontenera i przypisać nazwę do utworzonego kontenera w IronSecureDoc. Po wykonaniu polecenia wyświetli się poniższy komunikat.

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.

Utwórz nowy projekt Visual Studio
Visual Studio sprawia, że tworzenie projektów konsolowych jest bardzo powszechne i łatwe. Poniżej znajduje się kilka prostych kroków, które pomogą Ci rozpocząć pracę nad aplikacją konsolową w środowisku Visual Studio.
Zanim zaczniesz korzystać z programu Visual Studio, upewnij się, że masz go zainstalowanego na swoim komputerze.
Start a New Project:
After choosing File, Project, select the New menu.

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.

Select the location for your project.
Click "Create" to open the Console Application project.

What is Iron Software.SecureDoc.Client?
Iron Software.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 Iron Software.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, Iron Software.SecureDoc.Client has the tools to do all these tasks efficiently and securely.
Install Iron Software.SecureDoc.Client
First, run the installation of the Iron Software.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 Iron Software.SecureDoc.Client

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

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.

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

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

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

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

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.

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.
Kliknij Dalej.

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.

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()
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.

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.

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.

In the above processed file, the PDF document has been signed by the digital certificate.
Wnioski
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.
Często Zadawane Pytania
Jak mogę stworzyć serwer podpisujący PDF?
Możesz stworzyć serwer podpisujący PDF, korzystając z IronSecureDoc. Rozpocznij od zainstalowania obrazu Docker IronSecureDoc i uruchomienia kontenera w celu skonfigurowania serwera. Użyj klienta IronSecureDoc do przetwarzania i stosowania podpisów cyfrowych na dokumentach PDF.
Jakie kroki są wymagane do wdrożenia serwera podpisującego PDF za pomocą IronSecureDoc?
Wdrożenie serwera podpisującego PDF obejmuje instalację obrazu Docker IronSecureDoc, inicjalizację klienta IronSecureDoc i użycie go do zastosowania podpisów cyfrowych na dokumentach PDF. To zapewnia autentyczność i integralność dokumentów.
Jak dodać podpis cyfrowy do dokumentu PDF?
Aby dodać podpis cyfrowy do dokumentu PDF, użyj klienta IronSecureDoc. Zainicjalizuj klienta z usługą URL, następnie połącz się z usługą i użyj metody CertifyAsync. Podaj ścieżki do pliku PDF, certyfikatu podpisu i hasła do certyfikatu.
Jakie są zalety stosowania IronSecureDoc do podpisów cyfrowych?
IronSecureDoc oferuje zaawansowane szyfrowanie i podpisy cyfrowe w celu zapewnienia integralności i autentyczności dokumentów. Zapewnia bezpieczne udostępnianie dokumentów, zgodność z przepisami o ochronie danych i przyjazny interfejs, co czyni go idealnym rozwiązaniem dla firm wymagających wysokiego poziomu bezpieczeństwa.
Czy IronSecureDoc może pomóc w zgodności z zabezpieczeniem dokumentów?
Tak, IronSecureDoc pomaga w osiągnięciu zgodności z przepisami o ochronie danych, oferując bezpieczne przetwarzanie i przekazywanie dokumentów, co wspomaga organizacje w spełnianiu standardów branżowych i zapobieganiu naruszeniom danych.
Jaki jest proces instalacji obrazu Docker IronSecureDoc?
Aby zainstalować obraz Docker IronSecureDoc, upewnij się, że Docker jest zainstalowany w Twoim systemie, a następnie wykonaj polecenie docker pull ironsoftwareofficial/ironsecuredoc, aby pobrać obraz z repozytorium.
Jak mogę stworzyć cyfrowy identyfikator podpisu własnego dokumentu PDF?
Mogesz stworzyć cyfrowy identyfikator podpisu własnego, używając Adobe Acrobat, przechodząc do Preferencje > Podpisy > Więcej obok Tożsamości i Zaufanych Certyfikatów. Wybierz Cyfrowe ID, kliknij Dodaj ID i postępuj zgodnie z instrukcjami, aby utworzyć nowy cyfrowy ID w pliku .pfx lub .p12.
Co sprawia, że IronSecureDoc jest odpowiedni do obsługi dokumentów biznesowych i prawnych?
IronSecureDoc jest odpowiedni do obsługi dokumentów biznesowych i prawnych, ponieważ oferuje solidne szyfrowanie, podpisy cyfrowe, ślady audytowe i przyjazny interfejs użytkownika. Zapewnia ochronę przed nieautoryzowanym dostępem i utrzymuje integralność dokumentu.
Gdzie mogę dowiedzieć się więcej o cenach dla IronSecureDoc?
Możesz dowiedzieć się więcej o cenach dla IronSecureDoc, odwiedzając stronę z cenami pod adresem https://ironsoftware.com/enterprise/securedoc/licensing/. Oferują bezpłatny okres próbny i szczegółowe informacje o różnych opcjach cenowych.
Jaką rolę pełnią podpisy cyfrowe w bezpieczeństwie dokumentów?
Podpisy cyfrowe odgrywają kluczową rolę w bezpieczeństwie dokumentów, zapewniając kryptograficzne zabezpieczenie, które weryfikuje tożsamość podpisującego i zapewnia, że dokument nie został zmieniony od momentu podpisania, tym samym utrzymując jego integralność i autentyczność.




