Package org.apache.jackrabbit.core.security.authentication

Examples of org.apache.jackrabbit.core.security.authentication.CryptedSimpleCredentials


    Validate.notNull( encPass, Messages.getInstance().getString(
        "DefaultPentahoPasswordEncoder.ERROR_0002_ENCPASS_CANNOT_BE_NULL" ) ); //$NON-NLS-1$
    Validate.notNull( rawPass, Messages.getInstance().getString(
        "DefaultPentahoPasswordEncoder.ERROR_0001_RAWPASS_CANNOT_BE_NULL" ) ); //$NON-NLS-1$
    try {
      CryptedSimpleCredentials credentials = new CryptedSimpleCredentials( "dummyUser", encPass );
      return credentials.matches( new SimpleCredentials( "dummyUser", rawPass.toCharArray() ) );
    } catch ( Exception e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here


        "DefaultPentahoPasswordEncoder.ERROR_0001_RAWPASS_CANNOT_BE_NULL" ) ); //$NON-NLS-1$
    // same code as org.pentaho.platform.util.Base64PasswordService.encrypt()
    if ( StringUtil.isEmpty( rawPass ) ) {
      return rawPass;
    }
    CryptedSimpleCredentials cryptedCredentials;
    try {
      cryptedCredentials = new CryptedSimpleCredentials( new SimpleCredentials( "dummyUser", rawPass.toCharArray() ) );
      return cryptedCredentials.getPassword();
    } catch ( Exception e ) {
      throw new RuntimeException( e );
    }
  }
View Full Code Here

     * @return
     * @throws RepositoryException
     */
    static String buildPasswordValue(String password) throws RepositoryException {
        try {
            CryptedSimpleCredentials creds = new CryptedSimpleCredentials("_", password);
            return creds.getPassword();
        } catch (NoSuchAlgorithmException e) {
            throw new RepositoryException(e);
        } catch (UnsupportedEncodingException e) {
            throw new RepositoryException(e);
        }
View Full Code Here

     * @see User#getCredentials()
     */
    public Credentials getCredentials() throws RepositoryException {
        try {
            String password = getNode().getProperty(P_PASSWORD).getString();
            Credentials creds = new CryptedSimpleCredentials(getID(), password);
            return creds;
        } catch (NoSuchAlgorithmException e) {
            throw new RepositoryException(e);
        } catch (UnsupportedEncodingException e) {
            throw new RepositoryException(e);
View Full Code Here

     * @return
     * @throws RepositoryException
     */
    static String buildPasswordValue(String password) throws RepositoryException {
        try {
            return new CryptedSimpleCredentials("_", password).getPassword();
        } catch (NoSuchAlgorithmException e) {
            throw new RepositoryException(e);
        } catch (UnsupportedEncodingException e) {
            throw new RepositoryException(e);
        }
View Full Code Here

     * @see User#getCredentials()
     */
    public Credentials getCredentials() throws RepositoryException {
        try {
            String password = getNode().getProperty(P_PASSWORD).getString();
            return new CryptedSimpleCredentials(getID(), password);
        } catch (NoSuchAlgorithmException e) {
            throw new RepositoryException(e);
        } catch (UnsupportedEncodingException e) {
            throw new RepositoryException(e);
        }
View Full Code Here

     * @see User#changePassword(String, String)
     */
    public void changePassword(String password, String oldPassword) throws RepositoryException {
        // make sure the old password matches.
        try {
            CryptedSimpleCredentials csc = (CryptedSimpleCredentials) getCredentials();
            SimpleCredentials creds = new SimpleCredentials(getID(), oldPassword.toCharArray());
            if (!csc.matches(creds)) {
                throw new RepositoryException("Failed to change password: Old password does not match.");
            }
        } catch (NoSuchAlgorithmException e) {
            throw new RepositoryException("Cannot change password: failed to validate old password.");
        } catch (UnsupportedEncodingException e) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.security.authentication.CryptedSimpleCredentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.