fromString static method
- String algorithm
Returns the KeyAlgorithm corresponding to the given string algorithm
.
Throws an ArgumentError if the algorithm is invalid.
Implementation
static KeyAlgorithm fromString(String algorithm) {
return KeyAlgorithm.values.firstWhere(
(e) => e.value == algorithm,
orElse: () => throw ArgumentError('Invalid KeyAlgorithm: $algorithm'),
);
}