Share via


Find Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Searches an X509Certificate2Collection object using the search criteria specified by the X509FindType enumeration and the findValue object.

Namespace:  System.Security.Cryptography.X509Certificates
Assembly:  System.Security (in System.Security.dll)

Syntax

'Declaration
Public Function Find ( _
    findType As X509FindType, _
    findValue As Object, _
    validOnly As Boolean _
) As X509Certificate2Collection
public X509Certificate2Collection Find(
    X509FindType findType,
    Object findValue,
    bool validOnly
)
public:
X509Certificate2Collection^ Find(
    X509FindType findType, 
    Object^ findValue, 
    bool validOnly
)
member Find : 
        findType:X509FindType * 
        findValue:Object * 
        validOnly:bool -> X509Certificate2Collection 
public function Find(
    findType : X509FindType, 
    findValue : Object, 
    validOnly : boolean
) : X509Certificate2Collection

Parameters

  • validOnly
    Type: System. . :: . .Boolean
    true to allow only valid certificates to be returned from the search; otherwise, false.

Return Value

Type: System.Security.Cryptography.X509Certificates. . :: . .X509Certificate2Collection
An X509Certificate2Collection object.

Exceptions

Exception Condition
CryptographicException

findType is invalid.

Remarks

Use this method to find X509Certificate2 objects if no user interaction is needed. Use the Find method to allow the user to select X509Certificate2 objects.

Note that this method can be used in a cascading or nested style, narrowing the search criteria with each call to the method.

.NET Framework Security

See Also

Reference

X509Certificate2Collection Class

System.Security.Cryptography.X509Certificates Namespace