Albireo.Otp.Totp.GetKeyUri C# (CSharp) Метод

GetKeyUri() публичный статический Метод

Build a URI for secret key provisioning.
public static GetKeyUri ( HashAlgorithm algorithm, string issuer, string account, byte secret, int digits = Otp.DefaultDigits, int period = Totp.DefaultPeriod ) : string
algorithm HashAlgorithm The hashing algorithm for the HMAC computation.
issuer string The name of the entity issuing and maintaining the key.
account string The account name for which the one-time codes will work.
secret byte The ASCII-encoded base32-encoded shared secret.
digits int The number of digits of the one-time codes.
period int The period step for the HMAC counter computation.
Результат string
        public static string GetKeyUri(
            HashAlgorithm algorithm,
            string issuer,
            string account,
            byte[] secret,
            int digits = Otp.DefaultDigits,
            int period = Totp.DefaultPeriod)
        {
            Contract.Requires<ArgumentOutOfRangeException>(Enum.IsDefined(typeof(HashAlgorithm), algorithm));
            Contract.Requires<ArgumentOutOfRangeException>(algorithm != HashAlgorithm.Unknown);
            Contract.Requires<ArgumentNullException>(issuer != null);
            Contract.Requires<ArgumentOutOfRangeException>(!string.IsNullOrWhiteSpace(issuer));
            Contract.Requires<ArgumentNullException>(account != null);
            Contract.Requires<ArgumentOutOfRangeException>(!string.IsNullOrWhiteSpace(account));
            Contract.Requires<ArgumentNullException>(secret != null);
            Contract.Requires<ArgumentException>(secret.Length > 0);
            Contract.Requires<ArgumentOutOfRangeException>(digits > 0);
            Contract.Requires<ArgumentOutOfRangeException>(period > 0);
            Contract.Ensures(!string.IsNullOrWhiteSpace(Contract.Result<string>()));

            return
                Otp.GetKeyUri(
                    OtpType.Totp,
                    issuer,
                    account,
                    secret,
                    algorithm,
                    digits,
                    0,
                    period);
        }