As you mentioned, I will consider that you have access to the property Certificates class Signedcms.
This Certificates property represents a Collection of X509certificate2
The class X509certificate2 is the class that represents the certificate information. In this case the certificate that made the signature.
In this class you will find the property Subjectname which is the property that contains the subscriber’s name.
Then you can give a foreach on the Certificates property, an example :
using System;
using System.Security.Cryptography.Pkcs;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
SignedCms signedCms = new SignedCms();
foreach (var certificado in signedCms.Certificates)
{
Console.WriteLine(certificado.SubjectName.Name);
}
}
}
}
Or you can be more direct by extracting the certificate from the p7s file:
using System;
using System.Security.Cryptography.X509Certificates;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
X509Certificate2 cert = new X509Certificate2(@"C:\Temp\MeuPDFAssinado.p7s");
Console.WriteLine(cert.SubjectName.Name);
Console.ReadKey();
}
}
}