org.apache.jackrabbit.core.security.authentication
Class CryptedSimpleCredentials

java.lang.Object
  extended by org.apache.jackrabbit.core.security.authentication.CryptedSimpleCredentials
All Implemented Interfaces:
java.io.Serializable, javax.jcr.Credentials

public class CryptedSimpleCredentials
extends java.lang.Object
implements javax.jcr.Credentials

Crypted variant of the SimpleCredentials.

See Also:
Serialized Form

Constructor Summary
CryptedSimpleCredentials(javax.jcr.SimpleCredentials credentials)
          Take SimpleCredentials and digest the password if it is plain-text
CryptedSimpleCredentials(java.lang.String userId, java.lang.String password)
           
 
Method Summary
 java.lang.String getAlgorithm()
           
 java.lang.Object getAttribute(java.lang.String name)
           
 java.lang.String[] getAttributeNames()
           
 java.lang.String getPassword()
           
 java.lang.String getUserID()
           
 boolean matches(javax.jcr.SimpleCredentials credentials)
          Compair this instance with an instance of SimpleCredentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CryptedSimpleCredentials

public CryptedSimpleCredentials(javax.jcr.SimpleCredentials credentials)
                         throws java.security.NoSuchAlgorithmException,
                                java.io.UnsupportedEncodingException
Take SimpleCredentials and digest the password if it is plain-text

Parameters:
credentials -
Throws:
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException

CryptedSimpleCredentials

public CryptedSimpleCredentials(java.lang.String userId,
                                java.lang.String password)
                         throws java.security.NoSuchAlgorithmException,
                                java.io.UnsupportedEncodingException
Throws:
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException
Method Detail

getUserID

public java.lang.String getUserID()

getAttribute

public java.lang.Object getAttribute(java.lang.String name)

getAttributeNames

public java.lang.String[] getAttributeNames()

getAlgorithm

public java.lang.String getAlgorithm()

getPassword

public java.lang.String getPassword()

matches

public boolean matches(javax.jcr.SimpleCredentials credentials)
                throws java.security.NoSuchAlgorithmException,
                       java.io.UnsupportedEncodingException
Compair this instance with an instance of SimpleCredentials. If one the other Credentials' Password is plain-text treies to encode it with the current Digest.

Parameters:
credentials -
Returns:
true if UserID and Password match.
Throws:
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.