CertificateStore Constructor (String, CertStoreType, String, CryptoServiceProvider, RegistryStoreLocation)
Opens an existing or creates a new store of certificates.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public CertificateStore(
	string storeName,
	CertStoreType storeType,
	string pfxPassword,
	CryptoServiceProvider csp,
	RegistryStoreLocation registryLocation


Type: SystemString
The name of the certificate store or the filename if the store is a file.
Type: MailBee.SecurityCertStoreType
The type of the certificate store.
Type: SystemString
PFX (.P12, PKCS #12) password if storeType is Pfx; otherwise, not used and can be a null reference (Nothing in Visual Basic).
Type: MailBee.SecurityCryptoServiceProvider
A reference to CryptoServiceProvider instance descripting Cryptographic service provider (CSP) to be used for the given store, or a null reference (Nothing in Visual Basic) if the default CSP should be used. CSP is not used with PFX stores.
Type: MailBee.SecurityRegistryStoreLocation
Windows registry location of the system store if storeType is System; otherwise, not used and can be any RegistryStoreLocation value.
MailBeeInvalidArgumentExceptionstoreName is a null reference (Nothing in Visual Basic) or an empty string while storeType is neither Memory nor PfxBytes.
MailBeeIOExceptionThe specified PFX file can not be opened or read.
MailBeeCertificateStoreWin32ExceptionWin32 returned an error during opening the certificate store.

Only Memory stores can be created. Other stores can only be opened. It's possible, however, to create a memory store and then save it into a file using SaveToFile(String, CertStoreFileType, String) method. To create a new system store, use RegisterSystemStore(String, RegistryStoreLocation) method.

If you open a file store and then modify its contents, it won't be updated on disk until you save it back to the file. A system store, however, gets updated immediately in its registry location each time you call any method which modifies this store.

See Also