Gets a certificate from the Windows certificate repository.

Namespace: Nehta.VendorLibrary.Common
Assembly: Nehta.VendorLibrary.Common (in Nehta.VendorLibrary.Common.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public static X509Certificate2 GetCertificate(
	string findValue,
	X509FindType findType,
	StoreName storeName,
	StoreLocation storeLocation,
	bool valid
)
Visual Basic
Public Shared Function GetCertificate ( _
	findValue As String, _
	findType As X509FindType, _
	storeName As StoreName, _
	storeLocation As StoreLocation, _
	valid As Boolean _
) As X509Certificate2
Visual C++
public:
static X509Certificate2^ GetCertificate(
	String^ findValue, 
	X509FindType findType, 
	StoreName storeName, 
	StoreLocation storeLocation, 
	bool valid
)

Parameters

findValue
Type: System..::..String
Find value.
findType
Type: System.Security.Cryptography.X509Certificates..::..X509FindType
Find type.
storeName
Type: System.Security.Cryptography.X509Certificates..::..StoreName
Store name.
storeLocation
Type: System.Security.Cryptography.X509Certificates..::..StoreLocation
Store location.
valid
Type: System..::..Boolean
Valid certificate flag.

Return Value

Matching certificate.

Exceptions

ExceptionCondition
[!:UtilsException]Thrown when the certificate is not found or more than one is found.

See Also