PrivateKey trust permissions for local machine “Trusted roots” certificates
I have a certificate that has to be imported into Certificates/Trusted Root Certification Authorities and has a corresponding private key. To actually access the key from code you need to set private key permissions to grant full access to particular IIS application pool. I totally understand that but the problem is that this can only be set on personal certificates and not trusted root ones. I've tried adding the same certificate to Personal store and the following code doesn't break: X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine); store.Open(OpenFlags.ReadOnly);