Team LiB
Previous Section Next Section

PBEKeySpecjavax.crypto.spec

Java 1.4

This class is a transparent representation of a password used in password-based encryption (PBE). The password is stored as a char array rather than as a String, so that the characters of the password can be overwritten when they are no longer needed (for increased security).

Figure 17-23. javax.crypto.spec.PBEKeySpec


public class PBEKeySpec implements java.security.spec.KeySpec {
// Public Constructors
     public PBEKeySpec(char[ ] password);  
     public PBEKeySpec(char[ ] password, byte[ ] salt, int iterationCount);  
     public PBEKeySpec(char[ ] password, byte[ ] salt, int iterationCount, int keyLength);  
// Public Instance Methods
     public final void clearPassword( );  
     public final int getIterationCount( );  
     public final int getKeyLength( );  
     public final char[ ] getPassword( );  
     public final byte[ ] getSalt( );  
}

    Team LiB
    Previous Section Next Section