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)
public: X509Certificate2Collection^ Find( X509FindType findType, Object^ findValue, bool validOnly )
Parameters
- findType
- Type: System.Security.Cryptography.X509Certificates..::..X509FindType
One of the X509FindType values.
- findValue
- Type: System..::..Object
The search criteria as an object.
- 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..::..X509Certificate2CollectionAn X509Certificate2Collection object.
| Exception | Condition |
|---|---|
| CryptographicException | findType is invalid. |
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.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.