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
| 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
generateSecretKey
public SecretKey generateSecretKey(String password,
byte[] salt,
int iterations)
throws InvalidKeySpecException
- Specified by:
generateSecretKey in interface Pbkdf2
- 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
generateSecretKey
public SecretKey generateSecretKey(String password)
throws InvalidKeySpecException
- Specified by:
generateSecretKey in interface Pbkdf2
- 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.