Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Mon, 18 Feb 2008 13:42:55 -0800 (PST),    group: microsoft.public.dotnet.security        back       


How to insert token PIN programmatically?   
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();
        }
date: Mon, 18 Feb 2008 13:42:55 -0800 (PST)   author:   unknown

Re: How to insert token PIN programmatically?   
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
> 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();
> }
date: Tue, 19 Feb 2008 20:00:14 +0000 (UTC)   author:   Dominick Baier

Re: How to insert token PIN programmatically?   
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

On 19 Fev, 20:00, Dominick Baier
 wrote:
> 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)
date: Tue, 4 Mar 2008 01:45:34 -0800 (PST)   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us