org.apache.jetspeed.security.spi.impl
Class AlgorithmUpgradePBEPasswordService

java.lang.Object
  extended by org.apache.jetspeed.security.util.PBEPasswordTool
      extended by org.apache.jetspeed.security.spi.impl.PBEPasswordService
          extended by org.apache.jetspeed.security.spi.impl.AlgorithmUpgradePBEPasswordService
All Implemented Interfaces:
org.apache.jetspeed.security.AlgorithmUpgradePasswordEncodingService, org.apache.jetspeed.security.PasswordEncodingService, org.apache.jetspeed.security.spi.AlgorithmUpgradeCredentialPasswordEncoder, org.apache.jetspeed.security.spi.CredentialPasswordEncoder

public class AlgorithmUpgradePBEPasswordService
extends PBEPasswordService
implements org.apache.jetspeed.security.spi.AlgorithmUpgradeCredentialPasswordEncoder, org.apache.jetspeed.security.AlgorithmUpgradePasswordEncodingService

MessageDigestToPBEPasswordUpgradeService allows for migrating from a MessageDigestCredentialPasswordEncoder to the PBEPasswordService

Version:
$Id:$
Author:
Ate Douma

Field Summary
private  org.apache.jetspeed.security.spi.CredentialPasswordEncoder oldEncoder
           
private  Timestamp startPBEPasswordEncoding
           
 
Constructor Summary
AlgorithmUpgradePBEPasswordService(String pbePassword, org.apache.jetspeed.security.spi.CredentialPasswordEncoder oldEncoder, String startPBEPasswordEncoding)
           
 
Method Summary
 String encode(String userName, String clearTextPassword, org.apache.jetspeed.security.om.InternalCredential credential)
           
 void recodeIfNeeded(String userName, String clearTextPassword, org.apache.jetspeed.security.om.InternalCredential credential)
           
private  boolean usesOldEncodingAlgorithm(boolean encoded, Timestamp lastAuthDate, Timestamp prevAuthDate)
           
 boolean usesOldEncodingAlgorithm(org.apache.jetspeed.security.PasswordCredential credential)
           
 
Methods inherited from class org.apache.jetspeed.security.util.PBEPasswordTool
decode, encode, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.security.spi.CredentialPasswordEncoder
encode
 
Methods inherited from interface org.apache.jetspeed.security.PasswordEncodingService
decode, encode
 

Field Detail

oldEncoder

private org.apache.jetspeed.security.spi.CredentialPasswordEncoder oldEncoder

startPBEPasswordEncoding

private Timestamp startPBEPasswordEncoding
Constructor Detail

AlgorithmUpgradePBEPasswordService

public AlgorithmUpgradePBEPasswordService(String pbePassword,
                                          org.apache.jetspeed.security.spi.CredentialPasswordEncoder oldEncoder,
                                          String startPBEPasswordEncoding)
                                   throws InvalidKeySpecException,
                                          NoSuchAlgorithmException,
                                          ParseException
Throws:
InvalidKeySpecException
NoSuchAlgorithmException
ParseException
Method Detail

usesOldEncodingAlgorithm

public boolean usesOldEncodingAlgorithm(org.apache.jetspeed.security.PasswordCredential credential)
Specified by:
usesOldEncodingAlgorithm in interface org.apache.jetspeed.security.AlgorithmUpgradePasswordEncodingService
Specified by:
usesOldEncodingAlgorithm in interface org.apache.jetspeed.security.spi.AlgorithmUpgradeCredentialPasswordEncoder

encode

public String encode(String userName,
                     String clearTextPassword,
                     org.apache.jetspeed.security.om.InternalCredential credential)
              throws org.apache.jetspeed.security.SecurityException
Specified by:
encode in interface org.apache.jetspeed.security.spi.AlgorithmUpgradeCredentialPasswordEncoder
Throws:
org.apache.jetspeed.security.SecurityException

recodeIfNeeded

public void recodeIfNeeded(String userName,
                           String clearTextPassword,
                           org.apache.jetspeed.security.om.InternalCredential credential)
                    throws org.apache.jetspeed.security.SecurityException
Specified by:
recodeIfNeeded in interface org.apache.jetspeed.security.spi.AlgorithmUpgradeCredentialPasswordEncoder
Throws:
org.apache.jetspeed.security.SecurityException

usesOldEncodingAlgorithm

private boolean usesOldEncodingAlgorithm(boolean encoded,
                                         Timestamp lastAuthDate,
                                         Timestamp prevAuthDate)


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