public string GeneratePassword(string domainName, string masterPassword, int length,
                                       HmacGenerator hmacGenerator, CharacterSpace characterSpace)
        {
            IHmacGenerator generator = hmacGeneratorResolver.ResolverHmacGenerator(hmacGenerator);
            string         space     = characterSpaceGenerator.GenerateCharacterSpace(characterSpace);

            byte[] hmac              = generator.GenerateHmacHash(domainName, masterPassword);
            string password          = hmacToArbitraryEncodingConverter.ConvertToArbitraryEncodedString(hmac, space);
            string truncatedPassword = passwordTruncator.Truncate(password, length);

            return(truncatedPassword);
        }
예제 #2
0
 public string TestTruncate(string password, int desiredLength)
 {
     return(passwordTruncator.Truncate(password, desiredLength));
 }