public class PasswordFactory extends Object implements PasswordParameters
COUNT| Constructor and Description |
|---|
PasswordFactory(String algo) |
PasswordFactory(String algo,
int count) |
| Modifier and Type | Method and Description |
|---|---|
char[] |
create()
Create a new password
|
char[] |
create(char[] seed) |
char[] |
create(char[] password,
byte[] salt,
int count)
Creates a default password using "xxxx-xxxx-xxxx-xxxxx".
|
char[] |
create(String seed)
Create a new password using a seed
|
static PasswordFactory |
getInstance()
Factory method to get a default instance
|
static PasswordFactory |
getInstance(String algo)
Factory method to get a default instance
|
static PasswordFactory |
getInstance(String algo,
int count)
Factory method to get a default instance
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitDefaultPassword, Saltpublic PasswordFactory(String algo)
public PasswordFactory(String algo, int count)
public static PasswordFactory getInstance()
public static PasswordFactory getInstance(String algo)
algo - algorithmpublic static PasswordFactory getInstance(String algo, int count)
algo - algorithmcount - the number of MessageDigest iterationspublic char[] create()
throws NoSuchAlgorithmException,
UnsupportedEncodingException
NoSuchAlgorithmException - the encryption algorithm is not supportedUnsupportedEncodingException - the requested encoding is not supportedpublic char[] create(String seed) throws NoSuchAlgorithmException, UnsupportedEncodingException
seed - the default password supplied by the callerNoSuchAlgorithmException - the encryption algorithm is not supportedUnsupportedEncodingException - the requested encoding is not supportedpublic final char[] create(char[] seed)
throws NoSuchAlgorithmException,
UnsupportedEncodingException
seed - the default password supplied by the callerNoSuchAlgorithmException - the encryption algorithm is not supportedUnsupportedEncodingException - the requested encoding is not supportedpublic char[] create(char[] password,
byte[] salt,
int count)
throws NoSuchAlgorithmException,
UnsupportedEncodingException
salt - the password saltpassword - the default passwordcount - number of MessageDigest iterationsNoSuchAlgorithmException - the encryption algorithm is not supportedUnsupportedEncodingException - the requested encoding is not supportedCopyright © 2008–2020 The Apache Software Foundation. All rights reserved.