// Token: 0x0600516C RID: 20844 RVA: 0x0012D480 File Offset: 0x0012B680
 internal static IEnumerable <AlternateServiceAccountCredential> LoadFromRegistry(RegistryKey rootKey, bool decryptPasswords)
 {
     if (decryptPasswords)
     {
         AlternateServiceAccountConfiguration.EnsureCanDoCryptoOperations();
     }
     return(from valueName in rootKey.GetValueNames()
            select AlternateServiceAccountCredential.LoadFromRegistry(rootKey, valueName, decryptPasswords) into credential
                where credential != null
            select credential);
 }
        private static AlternateServiceAccountConfiguration LoadFromRegistry(string machineName, bool decryptPasswords)
        {
            AlternateServiceAccountConfiguration result = new AlternateServiceAccountConfiguration(machineName);

            result.DoRegistryOperation(true, delegate(RegistryKey rootKey)
            {
                result.credentials.AddRange(AlternateServiceAccountCredential.LoadFromRegistry(rootKey, decryptPasswords));
            }, new Func <string, LocalizedString>(DirectoryStrings.FailedToReadAlternateServiceAccountConfigFromRegistry));
            result.credentials.Sort();
            return(result);
        }
        // Token: 0x0600516B RID: 20843 RVA: 0x0012D408 File Offset: 0x0012B608
        internal static AlternateServiceAccountCredential Create(TimeSpan randomizationTimeStampDelta, PSCredential credential)
        {
            if (credential == null)
            {
                throw new ArgumentNullException("credential");
            }
            AlternateServiceAccountConfiguration.EnsureCanDoCryptoOperations();
            string domain;
            string userName;

            AlternateServiceAccountCredential.ParseQualifiedUserName(credential.UserName, out domain, out userName);
            DateTime whenAddedUtc = DateTime.UtcNow + randomizationTimeStampDelta;

            return(new AlternateServiceAccountCredential(AlternateServiceAccountCredential.GetRegistryValueName(whenAddedUtc), null, true, whenAddedUtc, domain, userName, credential.Password));
        }
 internal static AlternateServiceAccountConfiguration LoadWithPasswordsFromRegistry()
 {
     return(AlternateServiceAccountConfiguration.LoadFromRegistry(null, true));
 }
 internal static AlternateServiceAccountConfiguration LoadFromRegistry(string machineName)
 {
     return(AlternateServiceAccountConfiguration.LoadFromRegistry(machineName, false));
 }