javax.crypto.interfaces

Interface PBEKey

public interface PBEKey extends SecretKey

Interface to a password-derived key for password-based encryption (PBE). Applications working with a {@link javax.crypto.SecretKey} that is known to be a password-based key can safely cast such keys to this interface.

Since: 1.4

Field Summary
longserialVersionUID
Compatible with JDK1.4.
Method Summary
intgetIterationCount()
Retruns the iteration count, or 0 if not specified.
char[]getPassword()
Returns a copy of the password as a character array.
byte[]getSalt()
Returns a copy of the salt.

Field Detail

serialVersionUID

public long serialVersionUID
Compatible with JDK1.4.

Method Detail

getIterationCount

public int getIterationCount()
Retruns the iteration count, or 0 if not specified.

Returns: The iteration count.

getPassword

public char[] getPassword()
Returns a copy of the password as a character array. It is the caller's responsibility to zero-out the password when it is no longer in use.

Although it is not specified in the documentation, implementations should not copy or clone the password array, but rather return the reference to the array itself, so the caller has the ability to erase the password.

Returns: The password.

getSalt

public byte[] getSalt()
Returns a copy of the salt. It is the caller's responsibility to zero-out the salt when it is no longer in use.

Although it is not specified in the documentation, implementations should not copy or clone the salt array, but rather return the reference to the array itself, so the caller has the ability to erase the salt.

Returns: The salt.