I am using ASP.NET, C# and iTextSharp 5.3.0 for creating and digitally signing a PDF. Then I need to use pfx file while signing. Can someone explain what it will contain?
Edit:
Thanks, so it is having the keypair.
I did used this code.
FileStream fs = new FileStream(CERT_PATH, FileMode.Open);
Pkcs12Store ks = new Pkcs12Store(fs, CERT_PASSW.ToCharArray());
string alias = null;
foreach (string al in ks.Aliases)
{
if (ks.IsKeyEntry(al) && ks.GetKey(al).Key.IsPrivate)
{
alias = al;
break;
}
}
Certificate[] x = ks.getCertificateChain(alias)
X509Certificate[] chain=new X509Certificate[x.length]
for(int k=0;k<x.length;k++)
{
chain[k]=x[k].Certificate;
}
Thanks, It is working fine now.