* @param hashingMethod the hashing method
* @return the corresponding hashing method interceptor
*/
private InterceptorBean createHashingMethodInterceptor( LdapSecurityConstants hashingMethod )
{
InterceptorBean hashingMethodInterceptor = new InterceptorBean();
switch ( hashingMethod )
{
case HASH_METHOD_SHA:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SHA );
break;
case HASH_METHOD_SSHA:
default:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SSHA );
break;
case HASH_METHOD_MD5:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_MD5 );
break;
case HASH_METHOD_SMD5:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SMD5 );
break;
case HASH_METHOD_CRYPT:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_CRYPT );
break;
case HASH_METHOD_SHA256:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SHA256 );
break;
case HASH_METHOD_SSHA256:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SSHA256 );
break;
case HASH_METHOD_SHA384:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SHA384 );
break;
case HASH_METHOD_SSHA384:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SSHA384 );
break;
case HASH_METHOD_SHA512:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SHA512 );
break;
case HASH_METHOD_SSHA512:
hashingMethodInterceptor.setInterceptorClassName( FQCN_HASHING_INTERCEPTOR_SSHA512 );
break;
}
hashingMethodInterceptor.setInterceptorId( getHashingMethodInterceptorId( hashingMethodInterceptor
.getInterceptorClassName() ) );
hashingMethodInterceptor.setEnabled( true );
return hashingMethodInterceptor;
}