org.apache.jetspeed.security.util
Class PBEPasswordTool

java.lang.Object
  extended by org.apache.jetspeed.security.util.PBEPasswordTool
Direct Known Subclasses:
PBEPasswordService

public class PBEPasswordTool
extends Object

PBEPasswordTool encodes and decodes user passwords using Password Based encryptionl

Version:
$Id$
Author:
Ate Douma

Field Summary
private static String CIPHER_ALGORITM
           
private  SecretKey pbeKey
           
private static byte[] PKCS_5_BASE_SALT
           
private static int PKCS_5_ITERATIONCOUNT
           
 
Constructor Summary
PBEPasswordTool(String pbePassword)
           
 
Method Summary
private  byte[] createSalt(byte[] secret)
           
 String decode(String userName, String encodedPassword)
           
 String encode(String userName, String clearTextPassword)
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CIPHER_ALGORITM

private static final String CIPHER_ALGORITM
See Also:
Constant Field Values

PKCS_5_ITERATIONCOUNT

private static final int PKCS_5_ITERATIONCOUNT
See Also:
Constant Field Values

PKCS_5_BASE_SALT

private static final byte[] PKCS_5_BASE_SALT

pbeKey

private SecretKey pbeKey
Constructor Detail

PBEPasswordTool

public PBEPasswordTool(String pbePassword)
                throws InvalidKeySpecException,
                       NoSuchAlgorithmException
Throws:
InvalidKeySpecException
NoSuchAlgorithmException
Method Detail

encode

public String encode(String userName,
                     String clearTextPassword)
              throws org.apache.jetspeed.security.SecurityException
Throws:
org.apache.jetspeed.security.SecurityException

decode

public String decode(String userName,
                     String encodedPassword)
              throws org.apache.jetspeed.security.SecurityException
Throws:
org.apache.jetspeed.security.SecurityException

createSalt

private byte[] createSalt(byte[] secret)

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.