org.apache.felix.useradmin.impl
Class CredentialAuthenticatorImpl

java.lang.Object
  extended by org.apache.felix.useradmin.impl.CredentialAuthenticatorImpl
All Implemented Interfaces:
CredentialAuthenticator

public class CredentialAuthenticatorImpl
extends Object
implements CredentialAuthenticator

This CredentialAuthenticatorImpl class is used for authentication of credentials. It provides methods for encrypting credentials. Based on system properties it will choose between Base64 encoding or different algorithm.

Version:
$Rev$ $Date$
See Also:
CredentialAuthenticator, MessageDigest, Base64

Constructor Summary
CredentialAuthenticatorImpl()
           Construct new CredentialAuthenticator.
 
Method Summary
 boolean authenticate(Object value, Object encryptedValue)
          Authenticate provided value against encrypted stored value.
 Object encryptCredential(Object credential)
          Encrypt provided credential value with one of algorithms Base64, SHA-1, etc.
 Base64 getBase64()
          This method returns Base64 encoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CredentialAuthenticatorImpl

public CredentialAuthenticatorImpl()

Construct new CredentialAuthenticator. Its reading system properties about algorithm which should be used for encoding,charset, secure random number generator algorithm. Default algorithm is Base64 which could be overridden.

Method Detail

encryptCredential

public Object encryptCredential(Object credential)
Description copied from interface: CredentialAuthenticator
Encrypt provided credential value with one of algorithms Base64, SHA-1, etc.

Specified by:
encryptCredential in interface CredentialAuthenticator
Parameters:
credential - to be encrypted.
Returns:
encrypted value.
See Also:
CredentialAuthenticator.encryptCredential(Object)

authenticate

public boolean authenticate(Object value,
                            Object encryptedValue)
Description copied from interface: CredentialAuthenticator
Authenticate provided value against encrypted stored value.

Specified by:
authenticate in interface CredentialAuthenticator
Parameters:
value - to be check against encrypted Value.
encryptedValue - encrypted value.
Returns:
true if user is authenticated false if not.
See Also:
CredentialAuthenticator.authenticate(Object, Object)

getBase64

public Base64 getBase64()
Description copied from interface: CredentialAuthenticator
This method returns Base64 encoder.

Specified by:
getBase64 in interface CredentialAuthenticator
Returns:
base64 encoder.
See Also:
CredentialAuthenticator.getBase64()


Copyright © 2011 Apache Software Foundation. All Rights Reserved.