We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Difference of SignedName and SubjectName in digital signatures

What is the difference between SignedName of a PDFSignature object and SubjectName of a certificate? I have signed a PDF with a digital signature. SignedName is empty and SubjectName contains the name of the certificate holder. Yet there is no function to set the SignedName. How and when is this property filled?

9 Replies

SL Sowmiya Loganathan Syncfusion Team October 17, 2019 01:05 PM UTC

Hi Thorsten, 

Thank you for contacting Syncfusion support. 

SignedName 
The SignedName of the PDF digital signature represent the name provided at signing time (it may signer name or any other) 

SubjectName 
The SubjectName is represent the certificate (.pfx or store certificate) subject name which is used to sign the PDF document. 


At present we do not have support to set the SignedName, while singing a PDF document. We will include this support in our upcoming Volume 4 release which will be available on December 2019 tentatively. However we can get this name while loading the PDF document which is singed using Adobe Acrobat.  

Please let us know if you have any concerns on this. 

Regards, 
Sowmiya Loganathan 



TT Thorsten Twellmann October 17, 2019 03:30 PM UTC

Thanks for the clarification. Accessing the SignedName is usually much easier in other libraries (e.g. Java pdfbox) than the SubjectName of a certificate. We are considering replacing Acrobat Reader with a custom tool and encountered the problem that is was empty when using your library. Good to know that your are going to populate this field soon.

Thanks
Thorsten  


SL Sowmiya Loganathan Syncfusion Team October 18, 2019 12:18 PM UTC

Hi Thorsten, 

We have created the sample to retrieve signed name of digital signature from the PDF document which is created using Adobe Acrobat and the name is retrieved properly without any issue. Please find the sample for the same from below, 

Please try the above sample in your end and let us know the result. However as promised earlier we will include the support for setting SignedName while signing the PDF document in our upcoming Volume 4 release. However, could you please let us know whether this support is required earlier then, we will consider and provide this support as a patch. 

Regards, 
Sowmiya Loganathan 



TT Thorsten Twellmann October 18, 2019 01:04 PM UTC

It seems that my account is not associated with the provided download.


SL Sowmiya Loganathan Syncfusion Team October 21, 2019 01:50 PM UTC

Hi Thorsten,  

Please try with the below sample link and let us know the result. 

Regards, 
Sowmiya Loganathan 



TT Thorsten Twellmann October 23, 2019 02:35 PM UTC

OK. thanks. Now it works. 

A patch that becomes available before the Volume 4 release would of cause be great.

Thanks for your support - very helpful as always.

Thorsten




PV Prakash Viswanathan Syncfusion Team October 24, 2019 06:22 AM UTC

Hi Thorsten, 

Thank you for the update.  

We will update the patch for “support to set the signed Name while singing a PDF document” usability feature on October 31, 2019.  

Regards, 
Prakash V 



SL Sowmiya Loganathan Syncfusion Team October 31, 2019 12:56 PM UTC

Hi Thorsten, 
 
We have added support for “adding SignedName while signing PDF document”. Please find the sample code snippet to set SignedName with PDF signature creation and get the same from existing PDF document below. 
 
//Creates a new PDF document. 
PdfDocument document = new PdfDocument(); 
//Adds a new page. 
PdfPageBase page = document.Pages.Add(); 
PdfGraphics graphics = page.Graphics; 
//Creates a certificate instance from PFX file with private key. 
PdfCertificate pdfCert = new PdfCertificate("PDF.pfx", "syncfusion"); 
//Creates a digital signature. 
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature"); 
//Sets an image for signature field. 
PdfBitmap signatureImage = new PdfBitmap("signature.png"); 
//Sets signature information 
signature.Bounds = new RectangleF(new PointF(0, 0), signatureImage.PhysicalDimension); 
signature.ContactInfo = "johndoe@owned.us"; 
signature.LocationInfo = "Honolulu, Hawaii"; 
signature.Reason = "I am author of this document."; 
//Sets signed name of signature 
signature.SignedName = "Syncfusion Signature"; 
//Draws the signature image. 
graphics.DrawImage(signatureImage, 0, 0); 
//Saves and closes the document. 
MemoryStream ms = new MemoryStream(); 
document.Save(ms); 
document.Close(true); 
 
// Load an existing PDF document 
PdfLoadedDocument ldoc = new PdfLoadedDocument(ms); 
// Gets the first signature field 
PdfLoadedSignatureField lField = ldoc.Form.Fields[0] as PdfLoadedSignatureField; 
// Gets signed name from signature 
string signedName = lField.Signature.SignedName; 
//Close the PDF document 
ldoc.Close(true); 
ldoc.Dispose(); 
 
The patch for this usability feature can be downloaded from the following location.  
 
Recommended approach - exe will perform automatic configuration 
Please find the patch setup from below location: 
 
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment 
Please find the patch assemblies alone from below location: 
 
NuGet package  
 
Assembly Version: 17.3.0.14 
Installation Directions :  
This patch should replace the files “Syncfusion.Pdf.Base.dll” under the following folder. 
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.5.1 
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\9.3.0.61\precompiledassemblies\9.3.0.61\4.0 
 
To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies. 
 
Note :  
You can change how you receive bug fixes by navigating to the following link and updating your preferences. 
 
Disclaimer :  
Please note that we have created this patch for version 17.3.0.14 specifically to add following usability feature(s) reported in this/the forum(s). 148363 
 
If you have received other patches for the same version for other products, please apply all patches in the order received. 
This fix will be included in our 2019 Volume 4 release which will be available by November 2019 tentatively. 
 
Regards, 
Sowmiya L 



SL Sowmiya Loganathan Syncfusion Team December 19, 2019 12:05 PM UTC

Hi Thorsten, 
 
We have included the feature “Adding SignedName when signing the PDF document” in our Essential Studio 2019 Volume 4 Release v17.4.0.39. We are glad to announce that it is rolled out and is available for download under the following link. 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Sowmiya Loganathan        


Loader.
Live Chat Icon For mobile
Up arrow icon