I'm trying to build a program (trying with C#) that signs a document
using a certificate inside a token. Have managed to build code that
does it, but still I'm asked for the PIN. Sample of code follows
below. Can anyone point out how to programmatically insert the code?
rj
-----------------------------------------------
public byte[] SignMsg(Byte[] msg, X509Certificate2 signerCert, bool
detached)
{
ContentInfo contentInfo = new ContentInfo(msg);
SignedCms signedCms = new SignedCms(contentInfo,
detached);
CmsSigner cmsSigner = new CmsSigner(signerCert);
cmsSigner.IncludeOption = X509IncludeOption.EndCertOnly;
signedCms.ComputeSignature(cmsSigner, false);
return signedCms.Encode();
}
Dominick Baier - 19 Feb 2008 20:00 GMT
Is this cert coming from a Smart Card or is it a soft cert?
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
> I'm trying to build a program (trying with C#) that signs a document
> using a certificate inside a token. Have managed to build code that
[quoted text clipped - 13 lines]
> signedCms.ComputeSignature(cmsSigner, false);
> return signedCms.Encode();
raymond_b_jimenez@yahoo.com - 04 Mar 2008 09:45 GMT
It's from a SafeNet iKey 2032
I've been able to use it from Java with no problems, but have had no
success with .Net
rj
> Is this cert coming from a Smart Card or is it a soft cert?
>
> -----
> Dominick Baier (http://www.leastprivilege.com)
>
> Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
Dominick Baier - 17 Mar 2008 20:15 GMT
This is not possible. And thats by design.
If you need to use the cert without the PIN - configure the token accordingly
(if possible).
-----
Dominick Baier (http://www.leastprivilege.com)
Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)
> It's from a SafeNet iKey 2032
> I've been able to use it from Java with no problems, but have had no
[quoted text clipped - 6 lines]
>> Developing More Secure Microsoft ASP.NET 2.0 Applications
>> (http://www.microsoft.com/mspress/books/9989.asp)