internal static string ToKeyUriValue(this OtpType type)
{
Contract.Requires<ArgumentOutOfRangeException>(Enum.IsDefined(typeof(OtpType), type));
Contract.Requires<ArgumentOutOfRangeException>(type != OtpType.Unknown);
Contract.Ensures(!string.IsNullOrWhiteSpace(Contract.Result<string>()));
switch (type)
{
case OtpType.Totp:
return "totp";
case OtpType.Hotp:
return "hotp";
default:
throw new NotSupportedException();
}
}