X509Certificate2Collection.Contains(X509Certificate2) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the X509Certificate2Collection object contains a specific certificate.
public:
bool Contains(System::Security::Cryptography::X509Certificates::X509Certificate2 ^ certificate);
public bool Contains (System.Security.Cryptography.X509Certificates.X509Certificate2 certificate);
override this.Contains : System.Security.Cryptography.X509Certificates.X509Certificate2 -> bool
Public Function Contains (certificate As X509Certificate2) As Boolean
Parameters
- certificate
- X509Certificate2
The X509Certificate2 object to locate in the collection.
Returns
true
if the X509Certificate2Collection contains the specified certificate
; otherwise, false
.
Exceptions
certificate
is null
.
Remarks
This method performs a linear search; therefore, the average execution time is proportional to the Count property. That is, this method is an O(n
) operation, where n
is Count.
This method determines equality by calling the Object.Equals method.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for