示例#1
0
        /// <summary>
        /// Securities the specified credentials storage.
        /// </summary>
        /// <param name="credentialsStorage">The credentials storage.</param>
        /// <returns>IBuildARestMSService.</returns>
        public IBuildARestMSService Security(IAmACredentialStore credentialsStorage)
        {
            credentialsStorage.Add(new Credential()
            {
                Id        = _configuration.Admin.Id,
                Algorithm = SupportedAlgorithms.SHA256,
                User      = _configuration.Admin.User,
                Key       = Convert.FromBase64String(_configuration.Admin.Key)
            });

            return(this);
        }
        /// <summary>
        /// Securities the specified credentials storage.
        /// </summary>
        /// <param name="credentialsStorage">The credentials storage.</param>
        /// <returns>IBuildARestMSService.</returns>
        public IBuildARestMSService Security(IAmACredentialStore credentialsStorage)
        {
            credentialsStorage.Add(new Credential()
            {
                Id        = "dh37fgj492je",
                Algorithm = SupportedAlgorithms.SHA256,
                User      = "******",
                Key       = Convert.FromBase64String("wBgvhp1lZTr4Tb6K6+5OQa1bL9fxK7j8wBsepjqVNiQ=")
            });

            return(this);
        }
        /// <summary>
        /// Securities the specified credentials storage.
        /// </summary>
        /// <param name="credentialsStorage">The credentials storage.</param>
        /// <returns>IBuildARestMSService.</returns>
        public IBuildARestMSService Security(IAmACredentialStore credentialsStorage)
        {
            credentialsStorage.Add(new Credential()
            {
                Id = _configuration.Admin.Id,
                Algorithm = SupportedAlgorithms.SHA256,
                User = _configuration.Admin.User,
                Key = Convert.FromBase64String(_configuration.Admin.Key)
            });

            return this;
        }