|
@@ -1,22 +1,19 @@
|
|
|
using ComPDFKit.DigitalSign;
|
|
|
using ComPDFKit.Import;
|
|
|
-using ComPDFKit.PDFAnnotation;
|
|
|
using ComPDFKit.PDFAnnotation.Form;
|
|
|
using ComPDFKit.PDFDocument;
|
|
|
using ComPDFKit.PDFPage;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.Drawing;
|
|
|
using System.IO;
|
|
|
-using System.Xml.Linq;
|
|
|
|
|
|
namespace DigitalSignatureTest
|
|
|
{
|
|
|
internal class DigitalSignatureTest
|
|
|
{
|
|
|
-
|
|
|
static private string parentPath = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(System.IO.Directory.GetCurrentDirectory())));
|
|
|
static private string outputPath = Path.Combine(parentPath, "Output", "CS");
|
|
|
+ static string trustedFolder = AppDomain.CurrentDomain.BaseDirectory + @"\TrustedFolder\";
|
|
|
|
|
|
static void Main()
|
|
|
{
|
|
@@ -31,6 +28,12 @@ namespace DigitalSignatureTest
|
|
|
{
|
|
|
Directory.CreateDirectory(outputPath);
|
|
|
}
|
|
|
+
|
|
|
+ if (!Directory.Exists(trustedFolder))
|
|
|
+ {
|
|
|
+ Directory.CreateDirectory(trustedFolder);
|
|
|
+ }
|
|
|
+ CPDFSignature.SignCertTrustedFolder = trustedFolder;
|
|
|
#endregion
|
|
|
|
|
|
#region Sample 0: Create certificate
|
|
@@ -225,12 +228,6 @@ namespace DigitalSignatureTest
|
|
|
|
|
|
Console.WriteLine("---Begin trusted---");
|
|
|
|
|
|
- string trustedFolder = AppDomain.CurrentDomain.BaseDirectory + @"\TrustedFolder\";
|
|
|
- if (!Directory.Exists(trustedFolder))
|
|
|
- {
|
|
|
- Directory.CreateDirectory(trustedFolder);
|
|
|
- }
|
|
|
- CPDFSignature.SignCertTrustedFolder = trustedFolder;
|
|
|
if (signatureCertificate.AddToTrustedCertificates())
|
|
|
{
|
|
|
Console.WriteLine("Certificate trusted status: " + signatureCertificate.IsTrusted.ToString());
|