edu.vt.middleware.crypt.pbe
Class PKCS12KeyGenerator

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

public class PKCS12KeyGenerator
extends AbstractPKCSKeyGenerator

Implements the password-based key generation function defined in section B of PKCS#12.

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
PKCS12KeyGenerator(DigestAlgorithm prf, byte[] saltBytes, int iterations)
          Creates a new instance that uses the given digest for the pseudorandom function.
 
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

PKCS12KeyGenerator

public PKCS12KeyGenerator(DigestAlgorithm prf,
                          byte[] saltBytes,
                          int iterations)
Creates a new instance that uses the given digest for the pseudorandom function.

Parameters:
prf - Pseudorandom function digest.
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.