Differentiate between Signature and Timestamp certificates in a signed pdf

Hello
SigningHub Two Signer Seal.pdf (413.7 KB)

I want to understand whether the certificate in the pdf is a signing certificate or a timestamp certificate with a code like the one below, but I can’t find a correct way. The ServiceProviderName in the certificate can be variable.

	using (MemoryStream mstrm = new MemoryStream(pPDFBytes))
	using (Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(mstrm))
		foreach (Aspose.Pdf.Forms.Field field in pdfDocument.Form)
		{
			Aspose.Pdf.Forms.SignatureField sf = field as Aspose.Pdf.Forms.SignatureField;

			if (sf != null && sf.Signature != null)
			{
				try
				{
					var a = sf.FullName;
					var b = sf.PartialName;
					var c = sf.Signature.TimestampSettings; // null for UAE
					var d = sf.Value;
					var e = sf.GetType();
					var f = sf.Signature.GetType().Name;
					var g = sf.Signature.ContactInfo;
					var i = sf.Signature.ServiceProviderName;
					var j = sf.Signature.Date;
					var k = sf.Signature.Location;
					var m = sf.Signature.Reason;
				}
				catch (Exception ex)
				{
					ex.HelpLink = ex.Message;
				}


				byte[] cert_arr = null;
				System.Security.Cryptography.X509Certificates.X509Certificate2 cert = null;

				using (MemoryStream ms = new MemoryStream())
				{
					sf.ExtractCertificate().CopyTo(ms);
					cert_arr = ms.ToArray();
					cert = new X509Certificate2(new X509Certificate(cert_arr));

					var SignerName = cert.GetNameInfo(X509NameType.SimpleName, false);
					var SignerEmail = cert.GetNameInfo(X509NameType.EmailName, false);
					var Provider = cert.GetNameInfo(X509NameType.SimpleName, true);
				}

			}
		}

@DigitalPen

We need to investigate and gather details for this case. For the purpose an investigation ticket has been generated as PDFNET-57581 in our issue tracking system. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi
Is there any result?

@DigitalPen

We are afraid that the ticket has not been yet resolved. We will prioritize it on a first come first serve basis and as soon as we make some progress towards its resolution, we will inform you. Please be patient and spare us some time.

We are sorry for the inconvenience.