From bea5d438feaec2a534acd02ed8cfed7d168e280e Mon Sep 17 00:00:00 2001 From: sameerkhan001 Date: Wed, 10 Sep 2025 13:16:18 +0530 Subject: [PATCH 1/3] 980802: Updated GitHub sample code in PDF Example branch. --- ...-line-text-redaction-using-quad-points.sln | 25 ++++++ ...ne-text-redaction-using-quad-points.csproj | 15 ++++ .../Output/.gitkeep | 0 .../Program.cs | 45 +++++++++++ .../Program.cs | 76 ++++++++++++------- .../Output/.gitkeep | 0 6 files changed, 134 insertions(+), 27 deletions(-) create mode 100644 Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points.sln create mode 100644 Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Multi-line-text-redaction-using-quad-points.csproj create mode 100644 Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Output/.gitkeep create mode 100644 Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Program.cs create mode 100644 Forms/Disable-Auto-Formatting-in-FormFields/.NET/Disable-Auto-Formatting-in-FormFields/Output/.gitkeep diff --git a/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points.sln b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points.sln new file mode 100644 index 00000000..a014588b --- /dev/null +++ b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36408.4 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Multi-line-text-redaction-using-quad-points", "Multi-line-text-redaction-using-quad-points\Multi-line-text-redaction-using-quad-points.csproj", "{4ACF1F8B-A43B-4148-9452-0587200478F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4ACF1F8B-A43B-4148-9452-0587200478F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4ACF1F8B-A43B-4148-9452-0587200478F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4ACF1F8B-A43B-4148-9452-0587200478F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4ACF1F8B-A43B-4148-9452-0587200478F8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {735E1E3B-6CCF-41EC-9ABA-187BF9AA9851} + EndGlobalSection +EndGlobal diff --git a/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Multi-line-text-redaction-using-quad-points.csproj b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Multi-line-text-redaction-using-quad-points.csproj new file mode 100644 index 00000000..bdf828ef --- /dev/null +++ b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Multi-line-text-redaction-using-quad-points.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Multi_line_text_redaction_using_quad_points + enable + enable + + + + + + + diff --git a/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Output/.gitkeep b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Program.cs b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Program.cs new file mode 100644 index 00000000..7596ccfb --- /dev/null +++ b/Annotation/Multi-line-text-redaction-using-quad-points/.NET/Multi-line-text-redaction-using-quad-points/Program.cs @@ -0,0 +1,45 @@ +using Syncfusion.Drawing; +using Syncfusion.Pdf; +using Syncfusion.Pdf.Graphics; +using Syncfusion.Pdf.Interactive; + +//Create a new PDF document. +PdfDocument document = new PdfDocument(); +//Create a new page. +PdfPage page = document.Pages.Add(); +//Creates a new Redaction annotation. +PdfRedactionAnnotation annot = new PdfRedactionAnnotation(); + +//set the bounds collection of redaction annotation. +List bounds = new List(); +bounds.Add(new RectangleF(100, 100, 50, 20)); +bounds.Add(new RectangleF(200, 150, 60, 25)); +annot.BoundsCollection = bounds; + +//set the innercolor +annot.InnerColor = Color.Black; +//set the bordercolor +annot.BorderColor = Color.Green; +//set the textcolor +annot.TextColor = Color.Yellow; +//set the font +annot.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 10); +//set overlaytext +annot.OverlayText = "Redact"; +//set text alignment +annot.TextAlignment = PdfTextAlignment.Right; +//Assign the RepeatText +annot.RepeatText = true; + +//Add the annotation to the page. +page.Annotations.Add(annot); + + +// Save the modified document using a new FileStream +using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write)) +{ + // Save changes to a new PDF file + document.Save(outputStream); +} +// Close the document and release resources +document.Close(true); \ No newline at end of file diff --git a/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs b/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs index 51891316..469f0356 100644 --- a/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs +++ b/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs @@ -4,60 +4,82 @@ using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography; -namespace Externally_sign_the_PDF_document { - internal class Program { - static void Main(string[] args) { - //Get the stream from the document +namespace Externally_sign_the_PDF_document +{ + internal class Program + { + static void Main(string[] args) + { + // Get the stream from the document FileStream documentStream = new FileStream(Path.GetFullPath(@"Data/Barcode.pdf"), FileMode.Open, FileAccess.Read); - //Load the existing PDF document + + // Load the existing PDF document PdfLoadedDocument loadedDocument = new PdfLoadedDocument(documentStream); - //Creates a digital signature. + // Create a digital signature PdfSignature signature = new PdfSignature(loadedDocument, loadedDocument.Pages[0], null, "Signature"); - //Sets the signature information. + + // Set the signature information signature.Bounds = new RectangleF(new PointF(0, 0), new SizeF(100, 30)); signature.Settings.CryptographicStandard = CryptographicStandard.CADES; signature.Settings.DigestAlgorithm = DigestAlgorithm.SHA1; - //Create an external signer. + // Create an external signer IPdfExternalSigner externalSignature = new ExternalSigner("SHA1"); - //Add public certificates. + // Add public certificates List certificates = new List(); - certificates.Add(new X509Certificate2(new X509Certificate2(Path.GetFullPath(@"Data/PDF.pfx"), "password123"))); + certificates.Add(new X509Certificate2(Path.GetFullPath(@"Data/PDF.pfx"), "password123")); signature.AddExternalSigner(externalSignature, certificates, null); - //Create file stream. - using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) { - //Save the PDF document to file stream. + // Create file stream + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + { + // Save the PDF document to file stream loadedDocument.Save(outputFileStream); } - //Close the document. + + // Close the document loadedDocument.Close(true); } - //Create the external signer class and sign the document hash. - class ExternalSigner : IPdfExternalSigner { + + // Create the external signer class and sign the document hash + class ExternalSigner : IPdfExternalSigner + { private string _hashAlgorithm; - public string HashAlgorithm { + + public string HashAlgorithm + { get { return _hashAlgorithm; } } - public ExternalSigner(string hashAlgorithm) { + public ExternalSigner(string hashAlgorithm) + { _hashAlgorithm = hashAlgorithm; } - public byte[] Sign(byte[] message, out byte[] timeStampResponse) { + + public byte[] Sign(byte[] message, out byte[] timeStampResponse) + { timeStampResponse = null; - X509Certificate2 digitalID = new X509Certificate2(new X509Certificate2(Path.GetFullPath(@"Data/PDF.pfx"), "password123")); - if (digitalID.PrivateKey is System.Security.Cryptography.RSACryptoServiceProvider) { - System.Security.Cryptography.RSACryptoServiceProvider rsa = (System.Security.Cryptography.RSACryptoServiceProvider)digitalID.PrivateKey; - return rsa.SignData(message, HashAlgorithm); + + FileStream certificateStream = new FileStream("PDF.pfx", FileMode.Open, FileAccess.Read); + X509Certificate2 digitalID = new X509Certificate2(certificateStream, "password123"); + + if (digitalID.PrivateKey is System.Security.Cryptography.RSACryptoServiceProvider rsaProvider) + { + return rsaProvider.SignData(message, HashAlgorithm); } - else if (digitalID.PrivateKey is RSACng) { - RSACng rsa = (RSACng)digitalID.PrivateKey; - return rsa.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); + else if (digitalID.PrivateKey is RSACng rsaCng) + { + return rsaCng.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); } + else if (digitalID.PrivateKey is System.Security.Cryptography.RSAOpenSsl rsaOpenSsl) + { + return rsaOpenSsl.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); + } + return null; } } } -} \ No newline at end of file +} diff --git a/Forms/Disable-Auto-Formatting-in-FormFields/.NET/Disable-Auto-Formatting-in-FormFields/Output/.gitkeep b/Forms/Disable-Auto-Formatting-in-FormFields/.NET/Disable-Auto-Formatting-in-FormFields/Output/.gitkeep new file mode 100644 index 00000000..e69de29b From 66dc33021eba7d727e43d879bc24af2d446add96 Mon Sep 17 00:00:00 2001 From: sameerkhan001 Date: Wed, 10 Sep 2025 13:23:41 +0530 Subject: [PATCH 2/3] 980802: Added sample project in Quad point --- ...ints-to-existing-redaction-annotations.sln | 25 ++++++++++ ...s-to-existing-redaction-annotations.csproj | 15 ++++++ .../Data/Input.pdf | Bin 0 -> 1388 bytes .../Output/.gitkeep | 0 .../Program.cs | 44 ++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations.sln create mode 100644 Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Adding-quad-points-to-existing-redaction-annotations.csproj create mode 100644 Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Data/Input.pdf create mode 100644 Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Output/.gitkeep create mode 100644 Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Program.cs diff --git a/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations.sln b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations.sln new file mode 100644 index 00000000..f047c4b7 --- /dev/null +++ b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36408.4 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Adding-quad-points-to-existing-redaction-annotations", "Adding-quad-points-to-existing-redaction-annotations\Adding-quad-points-to-existing-redaction-annotations.csproj", "{7EAC121E-76EB-4D12-AF60-D457BE069660}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7EAC121E-76EB-4D12-AF60-D457BE069660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7EAC121E-76EB-4D12-AF60-D457BE069660}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7EAC121E-76EB-4D12-AF60-D457BE069660}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7EAC121E-76EB-4D12-AF60-D457BE069660}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AC2186CF-C132-4B74-9E9B-995A2480B219} + EndGlobalSection +EndGlobal diff --git a/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Adding-quad-points-to-existing-redaction-annotations.csproj b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Adding-quad-points-to-existing-redaction-annotations.csproj new file mode 100644 index 00000000..88eef3cf --- /dev/null +++ b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Adding-quad-points-to-existing-redaction-annotations.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Adding_quad_points_to_existing_redaction_annotations + enable + enable + + + + + + + diff --git a/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Data/Input.pdf b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Data/Input.pdf new file mode 100644 index 0000000000000000000000000000000000000000..926334bb193a8a50df6df9d3190f3679971ed0a0 GIT binary patch literal 1388 zcmY!laBmM(dp@M-zeo_`MmyHcCmwrfPL8^kjb7DziPJTL&ACQ=y zTC89MR1*Z`IVKn7yX6<i0>_OE1Y#Ff`)j0%jh~3)TpEz{J3$$gl@&AWQ;gwmC&+bAZfdJjgHy ztJxOBn{8wc3^r7U@9p=^Z#Lj*dq44${GG#F-U>)bEPZlo(_6Ex(M#qk8;EdD;@fmS z-kxbqQdapaGuO`Kz1!wr_n$K7VAb-H#tBksv({WWrL^V!+M`ly8o7$Cx2L@id{jNB z+5DcfP{k8~DUmGDD(Mz; zRG`2-?%BFaUGK-2! z6if_(DZ)>|3`jy!oqtkRa0xIu=;KX1CPo(Mk&qj7FmJViz#ip~{M9-9nr4Ox-hoR^ zYAe^yTeU26iQFQ&m>Xdp6IUJxd3)b}JtJclU+2uk^0b+yJUTqn4(#M$W~`an=E!82 zoVXxi9vqaf0K71~$cO`IoBJLg%g&c{GD`CnrOe1! zo?TLE_%QPS4b!mBb*D0=UvIeV+1YsJ|7pkKU%6Le!hae^S-9=Kt?R=6XIseDQl(f% zt)*Pk9y)#W(P;^K&plHqo};r+i_2%`v<1tAzjdzdU75kPz2V%i>wi)n9Vq^tW~(;M zXy--VUyO^aZE6?l7Qek=ueQGHQjNoxpjlfpPc>RBezSM^rD~lLzcY`Q-A_2Q!)sWuck7jvOmruq1(WAu5HiW@!&w_zx@U$?|eP@ z@NZGacl!r3&;G`qIzYt>q6iAg&o5B`B^XeNhapkQbm3*-i8R;2=&@FWuv zl$r+QgeycF0t+cakP`ff#~eNF$e!FN$RHrVaB#P~O3*x~kVRr&KPunIXw+_AFxh8f tm(P<0|Fg1=9okhHqtCnutMftSSYlC0MG?p;hKA|>hH$O1pw(8BB1~P literal 0 HcmV?d00001 diff --git a/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Output/.gitkeep b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Program.cs b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Program.cs new file mode 100644 index 00000000..af65881b --- /dev/null +++ b/Annotation/Adding-quad-points-to-existing-redaction-annotations/.NET/Adding-quad-points-to-existing-redaction-annotations/Program.cs @@ -0,0 +1,44 @@ +using Syncfusion.Drawing; +using Syncfusion.Pdf.Graphics; +using Syncfusion.Pdf.Interactive; +using Syncfusion.Pdf.Parsing; + +// Load the existing PDF document using FileStream +using (FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/Input.pdf"), FileMode.Open, FileAccess.Read)) +{ + // Load the PDF document from the input stream + using (PdfLoadedDocument ldoc = new PdfLoadedDocument(inputStream)) + { + //Load the existing PdfLoadedRedactionAnnotation + PdfLoadedRedactionAnnotation annot = ldoc.Pages[0].Annotations[0] as PdfLoadedRedactionAnnotation; + + //set the bounds + List bounds = new List(); + bounds.Add(new RectangleF(100, 100, 50, 20)); + bounds.Add(new RectangleF(200, 150, 60, 25)); + annot.BoundsCollection = bounds; + + //set the inner color + annot.InnerColor = Color.Black; + //set the border color + annot.BorderColor = Color.Green; + //set the text color + annot.TextColor = Color.Yellow; + //set the font + annot.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 10); + //set overlay text + annot.OverlayText = "Redact"; + //set text alignment + annot.TextAlignment = PdfTextAlignment.Center; + annot.RepeatText = true; + + // Save the modified document using a new FileStream + using (FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.Write)) + { + // Save changes to a new PDF file + ldoc.Save(outputStream); + } + // Close the document and release resources + ldoc.Close(true); + } +} From 90211ee3b633ccfdb92eaf8aecf10fe81b014ce0 Mon Sep 17 00:00:00 2001 From: sameerkhan001 Date: Wed, 10 Sep 2025 13:38:57 +0530 Subject: [PATCH 3/3] 980802: Added workable code. --- .../Program.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs b/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs index 469f0356..5a6da695 100644 --- a/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs +++ b/Digital Signature/Externally-sign-the-PDF-document-using-IPdfExternalSigner/.NET/Externally-sign-the-PDF-document/Program.cs @@ -11,7 +11,7 @@ internal class Program static void Main(string[] args) { // Get the stream from the document - FileStream documentStream = new FileStream(Path.GetFullPath(@"Data/Barcode.pdf"), FileMode.Open, FileAccess.Read); + FileStream documentStream = new FileStream(Path.GetFullPath(@"../../../Data/Barcode.pdf"), FileMode.Open, FileAccess.Read); // Load the existing PDF document PdfLoadedDocument loadedDocument = new PdfLoadedDocument(documentStream); @@ -29,11 +29,11 @@ static void Main(string[] args) // Add public certificates List certificates = new List(); - certificates.Add(new X509Certificate2(Path.GetFullPath(@"Data/PDF.pfx"), "password123")); + certificates.Add(new X509Certificate2(Path.GetFullPath(@"../../../Data/PDF.pfx"), "password123")); signature.AddExternalSigner(externalSignature, certificates, null); // Create file stream - using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) + using (FileStream outputFileStream = new FileStream(Path.GetFullPath(@"../../../Output/Output.pdf"), FileMode.Create, FileAccess.ReadWrite)) { // Save the PDF document to file stream loadedDocument.Save(outputFileStream); @@ -61,21 +61,19 @@ public ExternalSigner(string hashAlgorithm) public byte[] Sign(byte[] message, out byte[] timeStampResponse) { timeStampResponse = null; + X509Certificate2 digitalID = new X509Certificate2(Path.GetFullPath(@"../../../Data/PDF.pfx"), "password123"); - FileStream certificateStream = new FileStream("PDF.pfx", FileMode.Open, FileAccess.Read); - X509Certificate2 digitalID = new X509Certificate2(certificateStream, "password123"); - - if (digitalID.PrivateKey is System.Security.Cryptography.RSACryptoServiceProvider rsaProvider) + if (digitalID.PrivateKey is RSACryptoServiceProvider rsaProvider) { return rsaProvider.SignData(message, HashAlgorithm); } else if (digitalID.PrivateKey is RSACng rsaCng) { - return rsaCng.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); + return rsaCng.SignData(message, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); } - else if (digitalID.PrivateKey is System.Security.Cryptography.RSAOpenSsl rsaOpenSsl) + else if (digitalID.PrivateKey is RSAOpenSsl rsaOpenSsl) { - return rsaOpenSsl.SignData(message, System.Security.Cryptography.HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); + return rsaOpenSsl.SignData(message, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); } return null;