PDF セキュリティのサブセクション
暗号化
Documentize PDF Security for .NET は、暗号化、復号化、署名機能を提供し、PDF ドキュメントのセキュリティを強化する強力なツールです。機密情報が機密に保たれ、許可されていないアクセスから保護されます。
PDF を暗号化する方法
PDF ドキュメントを暗号化するには、次の手順に従います。
- ユーザー パスワードと所有者パスワードを設定した
EncryptOptionsのインスタンスを作成 します。 AddInputメソッドで入力 PDF ファイルを追加 します。AddOutputメソッドで出力 PDF ファイルを追加 します。PdfSecurityクラスのEncryptメソッドを使用して暗号化を実行 します。
1// Create EncryptOptions object to set instructions
2var options = new EncryptOptions("123456", "qwerty");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Encrypt(options);主な機能:
- PDF ドキュメントの暗号化:ユーザー パスワードと所有者パスワードを設定して PDF ファイルを保護します。
- 自動化:暗号化および復号化を .NET アプリケーションに組み込んで、ワークフローを自動化できます。
- コンプライアンス:業界標準の文書セキュリティ要件を満たすようにドキュメントを保護します。
復号
The Documentize PDF Security for .NET is a powerful tool designed to enhance the security of your PDF documents by providing encryption, decryption and signing capabilities. It ensures that your sensitive information remains confidential and protected from unauthorized access.
PDF を復号する方法
- Create an instance of
DecryptionOptionswith the necessary password. - Add the input PDF file using the
AddInputmethod. - Add the output PDF file using
AddOutputmethod. - Execute the encryption using the
Decryptmethod ofPdfSecurityclass.
1// Create DecryptOptions object to set instructions
2var options = new DecryptOptions("123456");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Decrypt(options);主な機能:
- Decrypt PDF Documents: Remove encryption from PDFs when needed.
- Automation: Integrate encryption and decryption into your .NET applications for automated workflows.
- Compliance: Ensure your documents meet industry standards for document security。
署名
Documentize PDF Security for .NET コンポーネントは、ユーザーが PDF ドキュメントにデジタル署名を行えるようにします。署名の追加プロセスを簡素化し、真正性を保証し、PDF コンテンツを保護します。コンポーネントは、表示可能な署名と非表示の署名の両方をサポートし、署名の位置、理由、連絡先情報などをカスタマイズするオプションを提供します。
PDF ドキュメントの署名方法
PFX ファイルを使用して PDF ドキュメントに署名するには、次の手順に従います。
- PFX ファイルのパスとパスワードを指定して
SignOptionsクラスのインスタンスを作成します。 - 入力 PDF と出力ファイルをオプションに追加します。
Signメソッドを実行して署名を適用します。
1// Create SignOptions object to set instructions
2var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Perform the process
8PdfSecurity.Sign(options);PFX ファイルをストリームで使用する方法
ファイルパスの代わりにストリームとして提供された PFX 証明書を使用して PDF に署名することも可能です。これにより、証明書の保存方法を柔軟に取り扱えます。
1using var pfxStream = File.OpenRead(@"path_to_your_pfx_file.pfx");
2var options = new SignOptions(pfxStream, "password_of_your_pfx_file");
3options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
4options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
5// Perform the process
6PdfSecurity.Sign(options);非表示署名の適用方法
ドキュメント上に署名を表示せずに文書を保護する非表示署名を追加するには、Visible プロパティを false に設定します。
SignOptionsのインスタンスを作成します。Visibleをfalseに設定します。- 入出力ファイルを追加します。
Signを呼び出して非表示署名を適用します。
1var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
2options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
3options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
4// Configure invisible signature
5signOptions.Visible = false;
6// Perform the process
7PdfSecurity.Sign(options);PDF ドキュメント署名の追加オプションの使用方法
署名時に Reason、Contact、Location、PageNumber などの追加オプションを設定できます。
- PFX ファイルのパスとパスワードで
SignOptionsクラスのインスタンスを作成します。 - 入力 PDF と出力ファイルをオプションに追加します。
- 各種オプションに値を設定します。
Signメソッドを実行して署名を適用します。
1// Create SignOptions object to set instructions
2var options = new SignOptions("path_to_your_pfx_file.pfx", "password_of_your_pfx_file");
3// Add input file path
4options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
5// Set output file path
6options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
7// Optional parameters
8options.Reason = "my Reason";
9options.Contact = "my Contact";
10options.Location = "my Location";
11options.PageNumber = 3;
12// Perform the process
13PdfSecurity.Sign(options);PDF にタイムスタンプを追加する方法
PDF ドキュメントに安全なタイムスタンプを追加する手順は次のとおりです。
AddTimestampOptionsのインスタンスを作成 してタイムスタンピングプロセスを設定します。AddInputメソッドで入力 PDF ファイルを追加します。AddOutputで出力ファイルのパスを設定します。Signメソッドでタイムスタンピングを実行します。
1// Create SignOptions object to set instructions
2var options = new SignOptions("path_to_your_pfx_file.pfx", "password_for_your_pfx_file");
3options.TimestampOptions = new TimestampOptions("server_url");
4// Add input file path
5options.AddInput(new FileData("path_to_your_pdf_file.pdf"));
6// Set output file path
7options.AddOutput(new FileData("path_to_result_pdf_file.pdf"));
8// Perform the process
9PdfSecurity.Sign(options);タイムスタンプサーバーでカスタム認証を使用する方法
タイムスタンプサーバーに接続する際に基本認証情報を提供できます。これにより、ユーザー名とパスワードが必要なサーバーに認証できます。
1// Configure the timestamping options with authentication
2options.TimestampOptions = new TimestampOptions("timestamp_server_url", "username:password");主な機能
- PDF ドキュメントのデジタル署名:表示可能または非表示のデジタル署名で文書を保護します。
- PFX のサポート:PFX 証明書を使用して PDF ファイルに署名できます。
- カスタマイズ可能なオプション:理由、場所、連絡先情報などの署名設定を構成できます。
- 表示・非表示署名:署名を文書上に表示するかどうかを選択できます。
- カスタムタイムスタンプサーバー:独自のタイムスタンプサーバー URL と認証資格情報を使用できます。