简体   繁体   中英

X509Store location for .NetCore on Linux systems

I've recently discovered the [System.Security.Cryptography.X509Certificates.X509Store] class in .NetCore.

So I tried some basic interaction with PowerShell to import PFX certificate files. This really simplifies working with certificates in cross-platform scenarios :D

$cert = Get-PFXCertificate -FilePath '~/myCert.pfx'
$Store = [System.Security.Cryptography.X509Certificates.X509Store]::new('My')
$Store.Open('ReadWrite')
$Store.Add($cert)
$Store.Certificates
$Store.Close()

Where can I find this store on a Linux system? Is there a specific file per store (MY, Root)?

Solution

.NetCore / corefx related user certificate store is located in:

~/.dotnet/corefx/cryptography/x509stores/*

Local Machine and Current User Certificate Stores

Each of the system certificate stores has the following types:

  • Local machine certificate store : This type of certificate store is local to the computer and is global to all users on the computer. This certificate store is located in the registry under the HKEY_LOCAL_MACHINE root.

  • Current user certificate store : This type of certificate store is local to a user account on the computer. This certificate store is located in the registry under the HKEY_CURRENT_USER root.

You could check eg the following Registry provider locations (nothing legible inside):

HKLM:\SOFTWARE\Microsoft\SystemCertificates\My
HKLM:\SOFTWARE\Microsoft\SystemCertificates\Root
HKCU:\SOFTWARE\Microsoft\SystemCertificates\My
HKCU:\SOFTWARE\Microsoft\SystemCertificates\Root

And where are the registry files stored? Read eg Registry Hives Microsoft article (again, nothing legible inside)…

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM