public final class Account extends Object implements Comparable<Account>
| Modifier and Type | Class and Description |
|---|---|
static class |
Account.UrlComponents |
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ACCOUNT_NAME |
static String |
DEFAULT_ACCOUNT_URI |
static int |
DEFAULT_LENGTH |
static String |
DEFAULT_USERNAME |
static String |
ROOT_ACCOUNT_URI |
| Constructor and Description |
|---|
Account() |
Account(Account toClone) |
Account(String name,
boolean isFolder) |
Account(String name,
String url,
String username) |
Account(String name,
String desc,
String url,
String username,
AlgorithmType algorithm,
boolean hmac,
boolean trim,
int length,
String characterSet,
LeetType leetType,
LeetLevel leetLevel,
String modifier,
String prefix,
String suffix,
boolean sha256Bug)
Constructor which allows all members to be defined except for the ID which
will be constructed from a SHA-1 hash of the URL + username.
|
Account(String name,
String desc,
String url,
String username,
AlgorithmType algorithm,
boolean hmac,
boolean trim,
int length,
String characterSet,
LeetType leetType,
LeetLevel leetLevel,
String modifier,
String prefix,
String suffix,
boolean sha256Bug,
String id)
See the other constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUrlComponent(Account.UrlComponents urlComponent) |
void |
clearUrlComponents()
Clears the UrlComponents used with this account
|
int |
compareTo(Account o)
Implements the Comparable<Account> interface, this is based first on if the
account is a folder or not.
|
void |
copySettings(Account a)
Copies the settings (not including children or ID) from another account.
|
static String |
createId()
Creates an random ID from a string.
|
static String |
createId(Account acc)
Creates and _returns_ an ID from data in an account.
|
static String |
createId(String str)
Creates an ID from a string.
|
boolean |
equals(Object o)
Determines if these are the same object or not.
|
AlgorithmType |
getAlgorithm() |
String |
getCharacterSet() |
Account |
getChild(int index)
Gets a specifically indexed child.
|
ArrayList<Account> |
getChildren()
Gets a list of the child accounts.
|
String |
getDesc() |
String |
getId() |
LeetLevel |
getLeetLevel() |
LeetType |
getLeetType() |
int |
getLength() |
String |
getModifier() |
String |
getName() |
int |
getNestedChildCount()
Gets the count of all children (of children of children...).
|
ArrayList<AccountPatternData> |
getPatterns() |
String |
getPrefix() |
String |
getSuffix() |
String |
getUrl() |
Set<Account.UrlComponents> |
getUrlComponents()
If the urlComponents field is empty then the entire getUrl field will be used.
|
String |
getUsername() |
boolean |
hasChild(Account account)
Tests if an account is a direct child of this account.
|
boolean |
hasChildren() |
int |
hashCode() |
boolean |
isAutoPop() |
boolean |
isDefault()
Determines if this is the default account.
|
boolean |
isFolder() |
boolean |
isHmac() |
boolean |
isRoot()
Determines if this is the root account.
|
boolean |
isSha256Bug() |
boolean |
isTrim() |
static Account |
makeDefaultAccount() |
void |
removeUrlComponent(Account.UrlComponents urlComponent) |
void |
setAlgorithm(AlgorithmType algorithm) |
void |
setAutoPop(boolean b) |
void |
setCharacterSet(String characterSet) |
void |
setDesc(String s) |
void |
setHmac(boolean hmac) |
void |
setId(String id) |
void |
setIsFolder(boolean b) |
void |
setLeetLevel(LeetLevel leetLevel) |
void |
setLeetType(LeetType leetType) |
void |
setLength(int length) |
void |
setModifier(String modifier) |
void |
setName(String s) |
void |
setPatterns(Iterable<AccountPatternData> patterns)
This will make a deep clone of the passed in Iterable.
|
void |
setPrefix(String prefix) |
void |
setSha256Bug(boolean sha256Bug) |
void |
setSuffix(String suffix) |
void |
setTrim(boolean trim) |
void |
setUrl(String url) |
void |
setUrlComponents(Set<Account.UrlComponents> urlComponents) |
void |
setUsername(String username) |
String |
toDebugString() |
String |
toString() |
public static final String DEFAULT_ACCOUNT_NAME
public static final String DEFAULT_USERNAME
public static final String ROOT_ACCOUNT_URI
public static final String DEFAULT_ACCOUNT_URI
public static final int DEFAULT_LENGTH
public Account()
public Account(String name, boolean isFolder)
public Account(Account toClone)
public Account(String name, String desc, String url, String username, AlgorithmType algorithm, boolean hmac, boolean trim, int length, String characterSet, LeetType leetType, LeetLevel leetLevel, String modifier, String prefix, String suffix, boolean sha256Bug) throws Exception
name - - name for the accountdesc - - description for the accounturl - - the url of the accountusername - - the username for the accountalgorithm - - the algorithm to use against the master passwordhmac - - should you use the hmac versiontrim - - the trim the input textlength - - the length of the generated password for accountcharacterSet - - the characterSet to use for generated passwordleetType - - leet-ify the generated passwordleetLevel - - How much leet to usemodifier - - this field is to allow for adjustment of the outputted passwordprefix - - the prefix to put in front of every generated passwordsuffix - - the suffix to add behind every generated passwordsha256Bug - - has the buggy firefox javascript sha256Exception - on exception.public Account(String name, String desc, String url, String username, AlgorithmType algorithm, boolean hmac, boolean trim, int length, String characterSet, LeetType leetType, LeetLevel leetLevel, String modifier, String prefix, String suffix, boolean sha256Bug, String id)
name - - name for the accountdesc - - description for the accounturl - - the url of the accountusername - - the username for the accountalgorithm - - the algorithm to use against the master passwordhmac - - should you use the hmac versiontrim - - the trim the input textlength - - the length of the generated password for accountcharacterSet - - the characterSet to use for generated passwordleetType - - leet-ify the generated passwordleetLevel - - How much leet to usemodifier - - this field is to allow for adjustment of the outputted passwordprefix - - the prefix to put in front of every generated passwordsuffix - - the suffix to add behind every generated passwordsha256Bug - - has the buggy firefox javascript sha256id - - the id for the account (required to be already generated)Account(String, String, String, String, AlgorithmType, boolean, boolean, int, String, LeetType, LeetLevel, String, String, String, boolean)public static Account makeDefaultAccount()
public static String createId()
This is used to create the ID of the account which should be unique. There's no way for this object to know if it is truly unique so the database or GUI should do a check for uniqueness and re-hash if needed.
public static String createId(String str) throws Exception
This is used to create the ID of the account which should be unique. There's no way for this object to know if it is truly unique so the database or GUI should do a check for uniqueness and re-hash if needed.
str - The string to hash.Exception - Upon hashing error.public static String createId(Account acc) throws Exception
acc - The account to base the data off.Exception - on error.public void copySettings(Account a)
LEAVE THIS FUNCTION HERE so it's easy to see if new members are ever added so I don't forget to update it.
a - The other account to copy from.public String getName()
public void setName(String s)
public String getDesc()
public void setDesc(String s)
public boolean isFolder()
public boolean isAutoPop()
public void setAutoPop(boolean b)
public boolean isDefault()
public boolean isRoot()
public void setIsFolder(boolean b)
public AlgorithmType getAlgorithm()
public void setAlgorithm(AlgorithmType algorithm)
algorithm - the algorithm to setpublic boolean isHmac()
public void setHmac(boolean hmac)
hmac - the hmac to setpublic boolean isTrim()
public void setTrim(boolean trim)
trim - the trim to setpublic String getUrl()
public void setUrl(String url)
url - the url to setpublic int getLength()
public void setLength(int length)
length - the length to setpublic String getCharacterSet()
public void setCharacterSet(String characterSet)
characterSet - the characterSet to setpublic LeetType getLeetType()
public void setLeetType(LeetType leetType)
leetType - the leetType to setpublic LeetLevel getLeetLevel()
public void setLeetLevel(LeetLevel leetLevel)
leetLevel - the leetLevel to setpublic String getUsername()
public void setUsername(String username)
username - the username to setpublic String getModifier()
public void setModifier(String modifier)
modifier - the modifier to setpublic String getPrefix()
public void setPrefix(String prefix)
prefix - the prefix to setpublic String getSuffix()
public void setSuffix(String suffix)
suffix - the suffix to setpublic boolean isSha256Bug()
public void setSha256Bug(boolean sha256Bug)
sha256Bug - the sha256Bug to setpublic String getId()
public void setId(String id)
id - the id to setpublic final void clearUrlComponents()
public final void addUrlComponent(Account.UrlComponents urlComponent)
urlComponent - - Add a component of the url to be used as the input text for the generated passwordpublic final void removeUrlComponent(Account.UrlComponents urlComponent)
urlComponent - - Add a component of the url to be used as the input text for the generated passwordpublic final Set<Account.UrlComponents> getUrlComponents()
public final void setUrlComponents(Set<Account.UrlComponents> urlComponents)
urlComponents - - the Components to use of the url as the input text for the generated passwordpublic ArrayList<Account> getChildren()
public int getNestedChildCount()
public Account getChild(int index) throws IndexOutOfBoundsException
index - The index of the child to get.IndexOutOfBoundsException - upon invalid index.public boolean hasChildren()
public boolean hasChild(Account account)
account - check if the passed in account is a child of 'this' accountpublic int compareTo(Account o)
compareTo in interface Comparable<Account>o - The other account to compare to.public boolean equals(Object o)
public ArrayList<AccountPatternData> getPatterns()
public void setPatterns(Iterable<AccountPatternData> patterns)
patterns - the patterns to setpublic String toDebugString()
Copyright © 2018. All rights reserved.