toKeyAlgorithm method

KeyAlgorithm toKeyAlgorithm()

Implementation

KeyAlgorithm toKeyAlgorithm() {
  switch (this) {
    case 'RSA_2048':
      return KeyAlgorithm.rsa_2048;
    case 'RSA_1024':
      return KeyAlgorithm.rsa_1024;
    case 'RSA_4096':
      return KeyAlgorithm.rsa_4096;
    case 'EC_prime256v1':
      return KeyAlgorithm.ecPrime256v1;
    case 'EC_secp384r1':
      return KeyAlgorithm.ecSecp384r1;
    case 'EC_secp521r1':
      return KeyAlgorithm.ecSecp521r1;
  }
  throw Exception('$this is not known in enum KeyAlgorithm');
}