Albireo.Otp.Extensions.ToKeyUriValue C# (CSharp) Method

ToKeyUriValue() static private method

static private ToKeyUriValue ( this type ) : string
type this
return string
        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();
            }
        }