Click here to Skip to main content
15,919,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: like sql statement in c# Pin
MikeZ10111-Jan-08 5:16
MikeZ10111-Jan-08 5:16 
GeneralCode Generator Pin
Ashwani_kumar10-Jan-08 22:47
Ashwani_kumar10-Jan-08 22:47 
GeneralRe: Code Generator Pin
DavidNohejl11-Jan-08 1:12
DavidNohejl11-Jan-08 1:12 
Generalcolor for datagrid columns Pin
chithra.r10-Jan-08 22:26
chithra.r10-Jan-08 22:26 
GeneralRe: color for datagrid columns Pin
Justin Perez11-Jan-08 2:48
Justin Perez11-Jan-08 2:48 
QuestionIncluding a chm file in C#.net application Pin
Haj10-Jan-08 21:01
Haj10-Jan-08 21:01 
GeneralRe: Including a chm file in C#.net application Pin
Ajay.k_Singh10-Jan-08 21:49
Ajay.k_Singh10-Jan-08 21:49 
GeneralInstalling Certificate using C# Pin
wasife10-Jan-08 20:28
wasife10-Jan-08 20:28 
Hi,
I am trying to install a .pfx certificate in personal folder using a C# application. Every thing goes fine and certificate is installed. I can see that certificate in the Personal folder of both Current User and Local machine. But when i try to run my application and use that certificate, it throws exception with the message:

The credentials supplied to the package were not recognized
Stack Trac at System.Net.SSPIWrapper.AcquireCredentialsHandle(SSPIInterface SecModule, String package, CredentialUse intent, SecureCredential scc)......

But when i import this cert manually, it works just fine. Below is the code i am using for installing the certificate:

  Dim cert_personal As X509Certificate2 = Nothing<br />
        Try<br />
            cert_personal = New X509Certificate2<br />
            cert_personal.Import(Application.StartupPath  & "\Chain\Personal.pfx","My Password" , (X509KeyStorageFlags.UserKeySet Or X509KeyStorageFlags.Exportable))<br />
        Catch ex As Exception<br />
            MsgBox(ex.Message)<br />
        End Try<br />
        If cert_personal Is Nothing Then<br />
            Return False<br />
        End If<br />
<br />
        ''XXXXXXXXXXXXXXXXXXXXXXXX PERSONAL XXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br />
        Dim store As New X509Store(StoreName.My, StoreLocation.CurrentUser)<br />
        Try<br />
            store.Open(OpenFlags.ReadWrite)<br />
            Dim findVal As String = cert_personal.Thumbprint 'Thumbprint <br />
            Dim certColl As X509Certificate2Collection = store.Certificates.Find(X509FindType.FindByThumbprint, findVal, False)<br />
<br />
            If certColl.Count <= 0 Then<br />
                store.Add(cert_personal)<br />
            <br />
            End If<br />
        Catch ex As Exception<br />
            MsgBox(ex.Message)<br />
        Finally<br />
            store.Close()<br />
        End Try<br />
<br />


And almost same for installing in Local machine. The complete chain is also fine. But the problem is still there.
I can't use CertMgr since this cert is from a third party which is not , as per my info, supported by that.

Any suggestion, code sample, advice would be highly appreciated.
Thanks in advance,
Wasif Ehsan.
QuestionObjectPicker dialog: getting additional attributes by using C# + Interop Pin
gns1010-Jan-08 20:23
gns1010-Jan-08 20:23 
GeneralSome unsolf Question About PPC Pin
E_Gold10-Jan-08 19:48
E_Gold10-Jan-08 19:48 
Questionabout A* algorithm Pin
Member 475670910-Jan-08 19:33
Member 475670910-Jan-08 19:33 
GeneralRe: about A* algorithm Pin
Mohib Sheth10-Jan-08 19:39
Mohib Sheth10-Jan-08 19:39 
JokeRe: about A* algorithm Pin
Steve Echols10-Jan-08 19:52
Steve Echols10-Jan-08 19:52 
GeneralGeodesic Pin
Vikram A Punathambekar10-Jan-08 21:14
Vikram A Punathambekar10-Jan-08 21:14 
GeneralRe: Geodesic Pin
Steve Echols10-Jan-08 21:27
Steve Echols10-Jan-08 21:27 
GeneralRe: Geodesic Pin
Dan Neely11-Jan-08 2:14
Dan Neely11-Jan-08 2:14 
GeneralRe: about A* algorithm Pin
Member 475670910-Jan-08 20:18
Member 475670910-Jan-08 20:18 
GeneralRe: about A* algorithm Pin
DavidNohejl11-Jan-08 3:44
DavidNohejl11-Jan-08 3:44 
GeneralHelp me to implement code compress file . Pin
Vampire1986hieu10-Jan-08 19:29
Vampire1986hieu10-Jan-08 19:29 
GeneralRe: Help me to implement code compress file . Pin
benjymous11-Jan-08 0:55
benjymous11-Jan-08 0:55 
GeneralRe: Help me to implement code compress file . Pin
Vampire1986hieu11-Jan-08 13:45
Vampire1986hieu11-Jan-08 13:45 
GeneralRe: Help me to implement code compress file . Pin
Scott Dorman12-Jan-08 7:33
professionalScott Dorman12-Jan-08 7:33 
QuestionLoading C# library at run time in unmanaged code (VC++/COM) Pin
Member 421941910-Jan-08 19:17
Member 421941910-Jan-08 19:17 
GeneralReg:Impersonator using in C# .net Pin
P.T.R.K10-Jan-08 19:15
P.T.R.K10-Jan-08 19:15 
GeneralRe: Reg:Impersonator using in C# .net Pin
Pete O'Hanlon11-Jan-08 1:49
mvePete O'Hanlon11-Jan-08 1:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.