.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to use localmachine certificate store?

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :.NET Framework



I'm trying to read the LocalMachine certificate store in my c# program. When I read the user cert tore it reads successfully the store however when I try to read the LocalMachine store it gets no result. It seems a permission problem but I don't get any error messages just got no result. Anyway I don't get a null value but the "Mycert.count" equals 0.

I tryed the following code:

X509Store myStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);

Could somebody help me how can I read the local machine certificate store without giving the service user administrator permission?



I'm not a development! I'm an infrastructure engineer! Please be patient on the development forums! :)

View Complete Post

More Related Resource Links

WCF Service Unable to Access Personal Certificate Store Unless Service Account is Logged In

I created a WCF service that has a method which makes a call to a SOAP web service over the internet. In order to make a call to the SOAP web service, it requires that an X.509 certificate be sent with the HttpWebRequest. The X.509 certificates are loaded in the Personal and Trusted Certificate store of the account which the service is running under. When the service account is logged into the server, everything works just fine. However, when the service account is not physically logged onto the server, it has problems loading up the X.509 certificate and fails authentication when trying to make the HttpWebRequest. I am new to WCF services so I don't even know where to start looking. Can anyone please help? Thanks in advance.

Why doesn't the SharePoint 2010 STS use the Windows Certificate Store?


I've come across a few issues recently where I've needed to import certificates in to SharePoint 2010's certificate store AKA Manage Trusts in Central Admin. I’ve had to import trusted root certificates for Claims , Cross-Farm Service Applications , the User Profile Service Application, and I've noticed it's also a requirement for

Give assembly strong name using certificate store certificate

My company has provided me with a code signing certificate on a smart card whose private key is protected with a pin and is not exportable.  I can use "signtool" to sign the assembly with the smart card cert and I can "Sign the ClickOnce manifests" with the smart card cert as well.  In both cases, there is a straightforward option to choose a store certificate (the smart card cert is loaded into my personal store upon card insertion).  I am prompted for my pin when performing either action and the signing completes successfully.

Creating a strong name using the smart card cert seems to be a different story.  I can use

     sn -c [my smart card CSP]

which I know is effective because the key container name (blank in my case...is that a problem?) and the unique key container (a GUID) can be used as such

     sn -pc "[GUID or blank]" mytest.pub

and the error is "Failed to extract public key from key pair -- Key does not exist."

I said "effective" above because if I switch to my smart card CSP and then pass "sn -pc" something besides empty quotes or the correct GUID, I get the error "Failed to extract public key from key pair -- Keyset does not exist."  Notice the difference is "Key does not exist" vs. "Keyset<

Automatic certificate enrollment for local system failed to download certificates for ROOT store fro



I am getting below from certification which we installed for HTTPS:// site

“Automatic certificate enrollment for local system failed to download certificates for ROOT store from ldap:///CN=Certification Authorities,CN=Public Key Services,CN=Services,CN=Configuration,DC=XX,DC=XX,DC=XX?cACertificate?one?objectCategory=certificationAuthority (0x8007006e). The system cannot open the device or file specified.”

Now we are no need of accessing this HTTPS:// site so pls let me knwo how i can remove the previously installed certificate from my sharepoint server.



In what certificate store should we put server's certificates?



Assume system S owns a certificate C . The following quote suggests that if C is to be used by S's service apps to authenticate themselves to clients, then C should be stored in LCS . But if C is to be used by S's client apps to authenticate themselves to a service, then C should be stored inside CUS :



" • The local computer store (LCS). This contains the certificates accessed by machine processes, such as ASP.NET. Use this location to store certificates that authenticate the server to clients.

• The current user store (CUS). Interactive applications typically pl

Store a certificate in a local path


hi.. I have Installed a self signed certificate for a device in the device itself. When i tried to access the device using HTTPs Request , that installed a certificate in my local machine.. I know that has installed in Personal certificates location or in the trusted root authorities location. But I need the Exact physical path (disk location) of the certificate what i have installed. Is there a  way to find out the answer?



Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

How to store more than 4k bytes of data in SQL CE 4?


I need to store more than 4k of bytes in my SQLCE 4 database. How can I do that with the ASP.NET Web Pages 1.0?

1: The Microsoft.Data provider fails when I try to populate a parameter with more than 4k bytes.
2: Referencing SqlServerCe assembly and using SqlCeConnection/SqlCeCommand/SqlCeParameter throws exception:  SQL Server Compact is not intended for ASP.NET development.

How can I somehow map the generic DbType, which does not have NText as an option, to the ntext column in my database? (SqlCeParameter supports DbSqlType, which has ntext, but see problem #2)

Store and display Japanese characters



Can anyone tell me the best way of storing Japanese characters through ASP.NET.
I have to put characters into a asp:textbox on one page, which saves it to an Access DB.
On a second page I want to display the content in a asp:label.

Should I store the characters directly to the database or should they be encoded, and
how do I encode the characters? 

In my web.config i have:

<globalization fileEncoding="ISO-2022-JP" requestEncoding="ISO-2022-JP" responseEncoding="ISO-2022-JP" culture="ja-JP" uiCulture="ja-JP" />  

On the display page I have:

<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=shift_jis">


Internet Explorer 8: New Features To Slice, Store, And Accelerate Your Web Applications


Internet Explorer 8 sports some exciting new features including Web Slices, Accelerators, and search suggestions along with AJAX navigation and DOM storage.

Daron Yöndem

MSDN Magazine March 2009

Spider in .NET: Crawl Web Sites and Catalog Info to Any Data Store with ADO.NET and Visual Basic .NE


Visual Basic .NET comes loaded with features not available in previous versions, including a new threading model, custom class creation, and data streaming. Learn how to take advantage of these features with an application that is designed to extract information from Web pages for indexing purposes. This article also discusses basic database access, file I/O, extending classes for objects, and the use of opacity and transparency in forms.

Mark Gerlach

MSDN Magazine October 2002

SQL Server CE: New Version Lets You Store and Update Data on Handheld Devices


Handheld device users need to be able to synchronize with a main data store when it's convenient and, preferably, when the back-end database server isn't busy. SQL Server 2000 Windows CE Edition allows you to build a traveling data store that can be displayed and run on a variety of devices. SQL Server CE supports a subset of the full SQL Server package, and can be used as a standalone server or in tandem with SWL Server and IIS. The architecture of SQL Server CE, along with data manipulation, synchronization, and connectivity issues, are discussed in this article. Topics such as making your data public, choosing the right type of replication, and handling errors are also covered.

Paul Yao and David Durant

MSDN Magazine June 2001

how to store User Rights Information in asp.net



Please guide me how to store user rigths inforamtion in asp.net MVC Application

Here my User permission  information look like

UserID LoginID          UserName             Page  Permission     Role 

yahoo@yahoo.com Mohammed Askar Quote Edit                Admin 
yahoo@yahoo.com Mohammed Askar Quote Delete            Admin 
yahoo@yahoo.com Mohammed Askar Quote Verify             Admin


gamil@gamil.com   Mr. X                      Quote Cancel  &nbs

How to store and retrieve multiple values in a single session variable .


I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.

Best Practice to store images and rich media


I am working on a project in which I have to store atleast 100000 images and rich media like virtual tour, promotional videos.

I would like to know the best practice to store it in order to retrieve it in show it on website.

What should I store it as:

Store the url into the database and store the actual image on the physical server. 

Store the image itself as a binary into the sql server itself and then convert it to runtime and show on the website.

I need to know which way is the best and suitable way to do this task.


MVC2 Music Store - How to get store controller - store.aspx working {genre names displayed}



<p>Select from <%: Model.NumberOfGenres %> genres:</p><ul> <% foreach (string genreName in Model.Genres) { %>

<li> <%: genreName %> </li>

<% } %>


MOST PEOPLE WILL BE USING VISUAL STUDIO 2008 sp1, to get this to work change the <%:, ONLY WITH SEMI COLONS, TO <%=

Store Null Data In image datatype in sql server 2005



i wanted to store image in sqlserver database image field and i did. But now in some cases i want to store null value in that image field please let me know how to do this using file uploader.please give complete sample code.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend