org.jboss.aerogear.crypto.password
Class DefaultPbkdf2
java.lang.Object
org.jboss.aerogear.crypto.password.DefaultPbkdf2
- All Implemented Interfaces:
- Pbkdf2
public class DefaultPbkdf2
- extends Object
- implements Pbkdf2
|
Method Summary |
byte[] |
encrypt(String password)
Generate the secret key |
byte[] |
encrypt(String password,
byte[] salt)
Generate the secret key |
byte[] |
encrypt(String password,
byte[] salt,
int iterations)
Generate the secret key |
byte[] |
getSalt()
|
boolean |
validate(String password,
byte[] encryptedPassword,
byte[] salt)
Validate the generated secret key |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
salt
private byte[] salt
secretKeyFactory
private SecretKeyFactory secretKeyFactory
DefaultPbkdf2
public DefaultPbkdf2(SecretKeyFactory keyFactory)
encrypt
public byte[] encrypt(String password,
byte[] salt,
int iterations)
throws InvalidKeySpecException
- Description copied from interface:
Pbkdf2
- Generate the secret key
- Specified by:
encrypt in interface Pbkdf2
- Returns:
- secret key
- Throws:
InvalidKeySpecException
encrypt
public byte[] encrypt(String password,
byte[] salt)
throws InvalidKeySpecException
- Description copied from interface:
Pbkdf2
- Generate the secret key
- Specified by:
encrypt in interface Pbkdf2
- Returns:
- secret key
- Throws:
InvalidKeySpecException
encrypt
public byte[] encrypt(String password)
throws InvalidKeySpecException
- Description copied from interface:
Pbkdf2
- Generate the secret key
- Specified by:
encrypt in interface Pbkdf2
- Returns:
- secret key
- Throws:
InvalidKeySpecException
validate
public boolean validate(String password,
byte[] encryptedPassword,
byte[] salt)
throws InvalidKeySpecException
- Description copied from interface:
Pbkdf2
- Validate the generated secret key
- Specified by:
validate in interface Pbkdf2
- Returns:
- secret key
- Throws:
InvalidKeySpecException
getSalt
public byte[] getSalt()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.