X509Util.FindCertificateBySubjectName Method

Finds an X.509 certificate by using its name in the specified X.509 store name and location.

Namespace: Microsoft.Web.Services3.Security.X509
Assembly: Microsoft.Web.Services3 (in microsoft.web.services3.dll)

Usage

'Usage
Dim subjectName As String
Dim storeLocation As StoreLocation
Dim storeName As String
Dim returnValue As X509Certificate2Collection
returnValue = X509Util.FindCertificateBySubjectName(subjectName, storeLocation, storeName)

Syntax

'Declaration
Public Shared Function FindCertificateBySubjectName( _
    ByVal subjectName As String, _
    ByVal storeLocation As StoreLocation, _
    ByVal storeName As String _
) As X509Certificate2Collection
public static X509Certificate2Collection FindCertificateBySubjectName(
    string subjectName, 
    StoreLocation storeLocation, 
    string storeName
);
public:
static X509Certificate2Collection^ FindCertificateBySubjectName(
    String^ subjectName,
    StoreLocation^ storeLocation,
    String^ storeName
);
public static X509Certificate2Collection FindCertificateBySubjectName(
    System.String subjectName, 
    StoreLocation storeLocation, 
    System.String storeName
);
public static function FindCertificateBySubjectName(
     subjectName : String, 
     storeLocation : StoreLocation, 
     storeName : String
) : X509Certificate2Collection;

Parameters

  • subjectName
    The subject name of a specific X.509 certificate.
  • storeLocation
    A System.Security.Cryptography.X509Certificates.StoreLocation that specifies the location of the X.509 certificate store.
  • storeName
    One of the System.Security.Cryptography.X509Certificates.StoreLocation.StoreName values.

Return Value

A System.Security.Cryptography.X509Certificates.StoreLocation.X509Certificate2Collection that contains the collection of X.509 certificates that match the specified criteria.

Exceptions

Exception type Condition
ArgumentNullException

subjectName is null

-or-

storeName is null

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows 2000, Windows 2000 Server, Windows 2000 Advanced Server

Target Platforms

See Also

Reference

X509Util Class
X509Util Members
Microsoft.Web.Services3.Security.X509 Namespace