CertificateStore Constructor (X509Store)
Initializes CertificateStore instance from the existing X509Store object.

Namespace: MailBee.Security
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public CertificateStore(
	X509Store x509Store
)

Parameters

x509Store
Type: System.Security.Cryptography.X509CertificatesX509Store
X509Store object representing the certificate store.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionx509Store is a null reference (Nothing in Visual Basic).
Remarks

In most cases, you won't need CertificateStore class at all. For instance, to load certificate store from a file (like PFX), use Import(Byte) method, you can then pass X509Certificate2Collection to the method like Decrypt2(MailMessage, X509Certificate2Collection).

Note Note
This is the only CertificateStore constructor available in .NET Standard 2.0 edition. Other constructors are Win32-specific and can be considered deprecated.
Examples
This sample opens Personal store.
// To use the code below, import these namespace at the top of your code
using MailBee.Security;
using System.Security.Cryptography.X509Certificates;

// The actual code (put it into a method of your class).
X509Store personalX509Store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
personalX509Store.Open(OpenFlags.OpenExistingOnly);
CertificateStore store = new CertificateStore(personalX509Store);
// You can use it now. Once done, be sure to Dispose personalX509Store!
See Also