Name
PBEKeySpec
Synopsis
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( ); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.