Mentalis.org Security Library documentation

CertificateStore.FindCertificateByUsage Method (String[], Certificate)

Finds a certificate having an enhanced key extension that matches one of the keyUsage members.

[Visual Basic]
Overloads Public Function FindCertificateByUsage( _
   ByVal keyUsage As String(), _
   ByVal previous As Certificate _
) As Certificate
[C#]
public Certificate FindCertificateByUsage(
   string[] keyUsage,
   Certificate previous
);

Parameters

keyUsage
The list of enhanced key usages to search for.
previous
The previous certificate.

Return Value

The Certificate that comes after previous and that has at least one of the specified key usages -or- a null reference (Nothing in Visual Basic) if no other valid certificate could be found.

Exceptions

Exception TypeCondition
ArgumentNullExceptionkeyUsage is a null reference (Nothing in Visual Basic).
ArgumentExceptionkeyUsage is invalid.

See Also

CertificateStore Class | Org.Mentalis.Security.Certificates Namespace | CertificateStore.FindCertificateByUsage Overload List