aicas logo Jamaica 3.4 release 8

javax.crypto.spec
Class PBEKeySpec

java.lang.Object
  extended by javax.crypto.spec.PBEKeySpec
All Implemented Interfaces:
KeySpec

public class PBEKeySpec
extends Object
implements KeySpec

A wrapper for a password-based key, used for password-based encryption (PBE).

Examples of password-based encryption algorithms include:

Since:
1.4
See Also:
SecretKeyFactory, PBEParameterSpec

Constructor Summary
PBEKeySpec(char[] password)
          Create a new PBE key spec with just a password.
PBEKeySpec(char[] password, byte[] salt, int iterationCount)
          Create a PBE key spec with a password, salt, and iteration count.
PBEKeySpec(char[] password, byte[] salt, int iterationCount, int keyLength)
          Create a PBE key spec with a password, salt, iteration count, and key length.
 
Method Summary
 void clearPassword()
          Clear the password array by filling it with null characters.
 int getIterationCount()
          Get the iteration count, or 0 if it has not been specified.
 int getKeyLength()
          Get the generated key length, or 0 if it has not been specified.
 char[] getPassword()
          Get the password character array.
 byte[] getSalt()
          Get the salt bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBEKeySpec

public PBEKeySpec(char[] password)
Create a new PBE key spec with just a password.

Parameters:
password - The password char array.

PBEKeySpec

public PBEKeySpec(char[] password,
                  byte[] salt,
                  int iterationCount)
Create a PBE key spec with a password, salt, and iteration count.

Parameters:
password - The password char array.
salt - The salt bytes.
iterationCount - The iteration count.

PBEKeySpec

public PBEKeySpec(char[] password,
                  byte[] salt,
                  int iterationCount,
                  int keyLength)
Create a PBE key spec with a password, salt, iteration count, and key length.

Parameters:
password - The password char array.
salt - The salt bytes.
iterationCount - The iteration count.
keyLength - The generated key length.
Method Detail

clearPassword

public final void clearPassword()
Clear the password array by filling it with null characters.


getIterationCount

public final int getIterationCount()
Get the iteration count, or 0 if it has not been specified.

Returns:
The iteration count, or 0 if it has not been specified.

getKeyLength

public final int getKeyLength()
Get the generated key length, or 0 if it has not been specified.

Returns:
The key length, or 0 if it has not been specified.

getPassword

public final char[] getPassword()
Get the password character array.

Returns:
The password.

getSalt

public final byte[] getSalt()
Get the salt bytes.

Returns:
The salt.

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.