1 package org.apache.archiva.redback.policy.encoders;
4 * Copyright 2001-2006 The Apache Software Foundation.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 import org.apache.archiva.redback.policy.PasswordEncoder;
20 import org.springframework.stereotype.Service;
23 * PlainText PasswordEncoder for use in situtations where the password needs to be saved as-is.
24 * See {@link PasswordEncoder#encodePassword(String)} for details.
26 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
29 @Service("passwordEncoder#plaintext")
30 public class PlainTextPasswordEncoder
31 implements PasswordEncoder
34 public String encodePassword( String rawPass )
39 public String encodePassword( String rawPass, Object salt )
44 public boolean isPasswordValid( String encPass, String rawPass )
46 if ( encPass == null && rawPass != null )
51 return encPass.equals( rawPass );
54 public boolean isPasswordValid( String encPass, String rawPass, Object salt )
56 return isPasswordValid( encPass, rawPass );
59 public void setSystemSalt( Object salt )
61 // Ignore, not used in this plaintext encoder.