|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.seam.security.crypto.PBKDF2Parameters
public class PBKDF2Parameters
Copied from Matthias Gartner's PKCS#5 implementation - see http://rtner.de/software/PBKDF2.html
Parameter data holder for PBKDF2 configuration.
A free Java implementation of Password Based Key Derivation Function 2 as defined by RFC 2898. Copyright (c) 2007 Matthias Gärtner
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
For Details, see http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
Field Summary | |
---|---|
protected byte[] |
derivedKey
The derived key is actually only a convenience to store a reference derived key. |
protected String |
hashAlgorithm
|
protected String |
hashCharset
|
protected int |
iterationCount
|
protected byte[] |
salt
|
Constructor Summary | |
---|---|
PBKDF2Parameters()
Constructor. |
|
PBKDF2Parameters(String hashAlgorithm,
String hashCharset,
byte[] salt,
int iterationCount)
Constructor. |
|
PBKDF2Parameters(String hashAlgorithm,
String hashCharset,
byte[] salt,
int iterationCount,
byte[] derivedKey)
Constructor. |
Method Summary | |
---|---|
byte[] |
getDerivedKey()
|
String |
getHashAlgorithm()
|
String |
getHashCharset()
|
int |
getIterationCount()
|
byte[] |
getSalt()
|
void |
setDerivedKey(byte[] derivedKey)
|
void |
setHashAlgorithm(String hashAlgorithm)
|
void |
setHashCharset(String hashCharset)
|
void |
setIterationCount(int iterationCount)
|
void |
setSalt(byte[] salt)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] salt
protected int iterationCount
protected String hashAlgorithm
protected String hashCharset
protected byte[] derivedKey
Constructor Detail |
---|
public PBKDF2Parameters()
null
for byte arrays, UTF-8 as
character set and 1000 for iteration count.
public PBKDF2Parameters(String hashAlgorithm, String hashCharset, byte[] salt, int iterationCount)
hashAlgorithm
- for example HMacSHA1 or HMacMD5hashCharset
- for example UTF-8salt
- Salt as byte array, may be null
(not recommended)iterationCount
- Number of iterations to execute. Recommended value 1000.public PBKDF2Parameters(String hashAlgorithm, String hashCharset, byte[] salt, int iterationCount, byte[] derivedKey)
hashAlgorithm
- for example HMacSHA1 or HMacMD5hashCharset
- for example UTF-8salt
- Salt as byte array, may be null
(not recommended)iterationCount
- Number of iterations to execute. Recommended value 1000.derivedKey
- Convenience data holder, not used during computation.Method Detail |
---|
public int getIterationCount()
public void setIterationCount(int iterationCount)
public byte[] getSalt()
public void setSalt(byte[] salt)
public byte[] getDerivedKey()
public void setDerivedKey(byte[] derivedKey)
public String getHashAlgorithm()
public void setHashAlgorithm(String hashAlgorithm)
public String getHashCharset()
public void setHashCharset(String hashCharset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |