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
, Rsa2048
, Rsa3072
, and Rsa4096
. 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) || (algorithm == PivAlgorithm.Rsa3072) || (algorithm == PivAlgorithm.Rsa4096))
With this extension, you can simply write.
if (algorithm.IsRsa())