public SecureUTF8String generatePassword ( CharSequence masterPassword , String inputText , String username ) { SecureUTF8String securedMasterPassword ; if ( ! ( masterPassword instanceof SecureUTF8String ) ) { securedMasterPassword = new SecureUTF8String ( masterPassword . toString ( ) ) ; } else { securedMasterPassword = ( SecureUTF8String ) masterPassword ; } SecureUTF8String result = null ; try { Account accountToUse = getAccountForInputText ( inputText ) ; // use the one that takes a username if the username isn't null if ( username != null ) result = pwm . makePassword ( securedMasterPassword , accountToUse , inputText , username ) ; else result = pwm . makePassword ( securedMasterPassword , accountToUse , inputText ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } if ( result != null ) { return result ; } return new SecureUTF8String ( ) ; }
Generate the password based on the masterPassword from the matching account from the inputtext