MailBee.NET Objects 4.0

CertificateStore Constructor (String, CertStoreType, String)

Opens an existing or creates a new store of certificates.

public CertificateStore(
   string storeName,
   CertStoreType storeType,
   string pfxPassword
);

Parameters

storeName
The name of the certificate store or the filename if the store is a file.
storeType
The type of the certificate store.
pfxPassword
PFX password if storeType is Pfx; otherwise, can be a null reference (Nothing in Visual Basic).

Remarks

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 method. To create a new system store, use RegisterSystemStore 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.

Note   This overload opens system stores which are located in HKEY_CURRENT_USER registry branch only. To open a system store located in another branch of the registry (such as HKEY_LOCAL_MACHINE which is user-independent), use CertificateStore overload.

Exceptions

Exception TypeCondition
MailBeeInvalidArgumentException is a null reference (Nothing in Visual Basic) or an empty string while storeType is not Memory.
MailBeeIOExceptionThe specified PFX file can not be opened or read.
MailBeeCertificateStoreWin32ExceptionWin32 returned an error during opening the certificate store.

Example

The example is available in CertificateStore topic.

See Also

CertificateStore Class | MailBee.Security Namespace | CertificateStore Constructor Overload List