aerogear-crypto 0.1.0

org.jboss.aerogear.crypto.password
Class DefaultPbkdf2

java.lang.Object
  extended by org.jboss.aerogear.crypto.password.DefaultPbkdf2
All Implemented Interfaces:
Pbkdf2

public class DefaultPbkdf2
extends Object
implements Pbkdf2


Field Summary
private  byte[] salt
           
private  SecretKeyFactory secretKeyFactory
           
 
Constructor Summary
DefaultPbkdf2(SecretKeyFactory keyFactory)
           
 
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
 

Field Detail

salt

private byte[] salt

secretKeyFactory

private SecretKeyFactory secretKeyFactory
Constructor Detail

DefaultPbkdf2

public DefaultPbkdf2(SecretKeyFactory keyFactory)
Method Detail

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()

aerogear-crypto 0.1.0

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.