As you have quoted, I will consider that you have access to the Certificates of class SignedCms .
This Certificates property represents a collection of X509Certificate2
The X509Certificate2 class is the class that represents the certificate information. In this case the certificate that made the signature.
In this class you will find the SubjectName which is the property that contains the subscriber name.
Then you can give a foreach in 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 straightforward 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();
}
}
}