Examples of PasswordEncryptor


Examples of org.apache.ftpserver.usermanager.PasswordEncryptor

            // OK
        }
    }
   
    public void testMatchesNullStoredPassword() {
        PasswordEncryptor encryptor = createPasswordEncryptor();
       
        try {
            encryptor.matches("foo", null);
            fail("Must throw NullPointerException");
        } catch (NullPointerException e) {
            // OK
        }
    }
View Full Code Here

Examples of org.apache.ftpserver.usermanager.PasswordEncryptor

    protected PasswordEncryptor createPasswordEncryptor() {
        return new SaltedPasswordEncryptor();
    }

    public void testMatches() {
        PasswordEncryptor encryptor = createPasswordEncryptor();
       
        assertTrue(encryptor.matches("foo", "71288966:F7B097C7BB2D02B8C2ACCE8A17284715"));
       
        // check lower case
        assertTrue(encryptor.matches("foo", "71288966:f7b097C7BB2D02B8C2ACCE8A17284715"));
       
        assertFalse(encryptor.matches("foo", "bar:bar"));
    }
View Full Code Here

Examples of org.apache.ftpserver.usermanager.PasswordEncryptor

    protected PasswordEncryptor createPasswordEncryptor() {
        return new ClearTextPasswordEncryptor();
    }
   
    public void testMatches() {
        PasswordEncryptor encryptor = createPasswordEncryptor();

        assertTrue(encryptor.matches("foo", "foo"));
       
        assertFalse(encryptor.matches("foo", "bar"));
    }
View Full Code Here

Examples of org.apache.ftpserver.usermanager.PasswordEncryptor

       
        assertFalse(encryptor.matches("foo", "bar"));
    }
   
    public void testMatchesNullPasswordToCheck() {
        PasswordEncryptor encryptor = createPasswordEncryptor();
       
        try {
            encryptor.matches(null, "bar");
            fail("Must throw NullPointerException");
        } catch (NullPointerException e) {
            // OK
        }
    }
View Full Code Here

Examples of org.apache.ftpserver.usermanager.PasswordEncryptor

    protected PasswordEncryptor createPasswordEncryptor() {
        return new Md5PasswordEncryptor();
    }

    public void testMatches() {
        PasswordEncryptor encryptor = createPasswordEncryptor();
       
        assertTrue(encryptor.matches("foo", "ACBD18DB4CC2F85CEDEF654FCCC4A4D8"));
       
        // check lower case
        assertTrue(encryptor.matches("foo", "acbd18DB4CC2F85CEDEF654FCCC4A4D8"));
       
        assertFalse(encryptor.matches("foo", "bar"));
    }
View Full Code Here

Examples of org.apache.wss4j.common.crypto.PasswordEncryptor

        }
        return crypto;
    }
   
    protected PasswordEncryptor getPasswordEncryptor() {
        PasswordEncryptor passwordEncryptor =
            (PasswordEncryptor)message.getContextualProperty(
                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
            );
        if (passwordEncryptor != null) {
            return passwordEncryptor;
View Full Code Here

Examples of org.apache.wss4j.common.crypto.PasswordEncryptor

    }
   
    protected PasswordEncryptor getPasswordEncryptor(
        SoapMessage soapMessage, WSSSecurityProperties securityProperties
    ) {
        PasswordEncryptor passwordEncryptor =
            (PasswordEncryptor)soapMessage.getContextualProperty(
                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
            );
        if (passwordEncryptor != null) {
            return passwordEncryptor;
View Full Code Here

Examples of org.apache.wss4j.common.crypto.PasswordEncryptor

                LOG.fine("Cannot find Crypto Encryption properties: " + e);
                Exception ex = new Exception("Cannot find Crypto Encryption properties: " + e);
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
            }
           
            PasswordEncryptor passwordEncryptor = getPasswordEncryptor(message, requestData);
            encrCrypto = CryptoFactory.getInstance(props, Loader.getClassLoader(CryptoFactory.class),
                                                   passwordEncryptor);

            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
            synchronized (info) {
View Full Code Here

Examples of org.apache.wss4j.common.crypto.PasswordEncryptor

        }
        return encrCrypto;
    }
   
    private PasswordEncryptor getPasswordEncryptor(SoapMessage soapMessage, RequestData requestData) {
        PasswordEncryptor passwordEncryptor =
            (PasswordEncryptor)soapMessage.getContextualProperty(
                SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE
            );
        if (passwordEncryptor != null) {
            return passwordEncryptor;
View Full Code Here

Examples of org.apache.wss4j.common.crypto.PasswordEncryptor

                LOG.fine("Cannot find Crypto Signature properties: " + s);
                Exception ex = new Exception("Cannot find Crypto Signature properties: " + s);
                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, ex);
            }
           
            PasswordEncryptor passwordEncryptor = getPasswordEncryptor(message, requestData);
            signCrypto = CryptoFactory.getInstance(props, Loader.getClassLoader(CryptoFactory.class),
                                                   passwordEncryptor);

            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
            synchronized (info) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.