edu.vt.middleware.crypt.pbe
Class PBKDF2KeyGenerator

java.lang.Object
  extended by edu.vt.middleware.crypt.pbe.AbstractPKCSKeyGenerator
      extended by edu.vt.middleware.crypt.pbe.PBKDF2KeyGenerator
All Implemented Interfaces:
KeyGenerator

public class PBKDF2KeyGenerator
extends AbstractPKCSKeyGenerator

Implements the PBKDF2 key generation function defined in PKCS#5v2.

Version:
$Revision: 2744 $
Author:
Middleware Services

Field Summary
 
Fields inherited from class edu.vt.middleware.crypt.pbe.AbstractPKCSKeyGenerator
DEFAULT_ITERATION_COUNT, iterationCount, salt
 
Constructor Summary
PBKDF2KeyGenerator(byte[] saltBytes)
          Creates a new instance that uses SHA1 hash for pseudorandom function to generate derived keys.
PBKDF2KeyGenerator(byte[] saltBytes, int iterations)
          Creates a new instance that uses SHA1 hash for pseudorandom function to generate derived keys.
 
Method Summary
protected  org.bouncycastle.crypto.PBEParametersGenerator newParamGenerator()
          Creates a new BC parameter generator instance.
protected  byte[] toBytes(char[] password)
          Converts password characters to bytes in implementation-dependent fashion.
 
Methods inherited from class edu.vt.middleware.crypt.pbe.AbstractPKCSKeyGenerator
generate, setIterationCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBKDF2KeyGenerator

public PBKDF2KeyGenerator(byte[] saltBytes)
Creates a new instance that uses SHA1 hash for pseudorandom function to generate derived keys.

Parameters:
saltBytes - Key derivation function salt bytes.

PBKDF2KeyGenerator

public PBKDF2KeyGenerator(byte[] saltBytes,
                          int iterations)
Creates a new instance that uses SHA1 hash for pseudorandom function to generate derived keys.

Parameters:
saltBytes - Key derivation function salt bytes.
iterations - Key derivation function iteration count.
Method Detail

newParamGenerator

protected org.bouncycastle.crypto.PBEParametersGenerator newParamGenerator()
Creates a new BC parameter generator instance.

Specified by:
newParamGenerator in class AbstractPKCSKeyGenerator
Returns:
New parameter generator.

toBytes

protected byte[] toBytes(char[] password)
Converts password characters to bytes in implementation-dependent fashion.

Specified by:
toBytes in class AbstractPKCSKeyGenerator
Parameters:
password - Password to convert.
Returns:
Password bytes.


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.