IsRsa Method
IsRsa(PivAlgorithm)
Determines if the given algorithm is RSA.
C#
public static bool IsRsa(this PivAlgorithm algorithm)
Parameters
Type | Name | Description |
---|---|---|
PivAlgorithm | algorithm | The algorithm to check. |
Returns
System.Boolean
A boolean, true if the algorithm is RSA, and false otherwise.
Remarks
The PivAlgorithm enum contains Rsa1024
and Rsa2048
. But
sometimes you just want to know if an algorithm is RSA or not. It
would seem you would have to write code such as the following.
if ((algorithm == PivAlgorith.Rsa1024) || (algorithm == PivAlgorithm.Rsa2048))
With this extension, you can simply write.
if (algorithm.IsRsa())