|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.xephi.authme.security.pbkdf2.PBKDF2Engine
public class PBKDF2Engine
Request for Comments: 2898 PKCS #5: Password-Based Cryptography Specification
Version 2.0
PBKDF2 (P, S, c, dkLen)
Options:
Input:
Output:
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.
| Constructor Summary | |
|---|---|
PBKDF2Engine()
Constructor for PBKDF2 implementation object. |
|
PBKDF2Engine(PBKDF2Parameters parameters)
Constructor for PBKDF2 implementation object. |
|
PBKDF2Engine(PBKDF2Parameters parameters,
PRF prf)
Constructor for PBKDF2 implementation object. |
|
| Method Summary | |
|---|---|
byte[] |
deriveKey(java.lang.String inputPassword)
Convert String-based input to internal byte array, then invoke PBKDF2. |
byte[] |
deriveKey(java.lang.String inputPassword,
int dkLen)
Convert String-based input to internal byte array, then invoke PBKDF2. |
PBKDF2Parameters |
getParameters()
Allow reading of configured parameters. |
PRF |
getPseudoRandomFunction()
Get currently set Pseudo Random Function. |
static void |
main(java.lang.String[] args)
Convenience client function. |
void |
setParameters(PBKDF2Parameters parameters)
Allow setting of configured parameters. |
void |
setPseudoRandomFunction(PRF prf)
Set the Pseudo Random Function to use. |
boolean |
verifyKey(java.lang.String inputPassword)
Convert String-based input to internal byte arrays, then invoke PBKDF2 and verify result against the reference data that is supplied in the PBKDF2Parameters. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PBKDF2Engine()
public PBKDF2Engine(PBKDF2Parameters parameters)
parameters - Data holder for iteration count, method to use et cetera.
public PBKDF2Engine(PBKDF2Parameters parameters,
PRF prf)
parameters - Data holder for iteration count, method to use et cetera.prf - Supply customer Pseudo Random Function.| Method Detail |
|---|
public byte[] deriveKey(java.lang.String inputPassword)
PBKDF2
deriveKey in interface PBKDF2inputPassword - Candidate password to compute the derived key for.
public byte[] deriveKey(java.lang.String inputPassword,
int dkLen)
PBKDF2
deriveKey in interface PBKDF2inputPassword - Candidate password to compute the derived key for.dkLen - Specify desired key length
public boolean verifyKey(java.lang.String inputPassword)
PBKDF2
verifyKey in interface PBKDF2inputPassword - Candidate password to compute the derived key for.
true password match; false incorrect
passwordpublic PRF getPseudoRandomFunction()
PBKDF2
getPseudoRandomFunction in interface PBKDF2public PBKDF2Parameters getParameters()
PBKDF2
getParameters in interface PBKDF2public void setParameters(PBKDF2Parameters parameters)
PBKDF2
setParameters in interface PBKDF2public void setPseudoRandomFunction(PRF prf)
PBKDF2
setPseudoRandomFunction in interface PBKDF2prf - Pseudo Random Function to set.
public static void main(java.lang.String[] args)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
args - Supply the password as argument.
java.io.IOException
java.security.NoSuchAlgorithmException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||