Package org.geoserver.security.password

Examples of org.geoserver.security.password.GeoServerDigestPasswordEncoder


    /**
     * Checks the specified password against the master password.
     */
    public boolean checkMasterPassword(char[] passwd) {
        GeoServerDigestPasswordEncoder pwEncoder =
                loadPasswordEncoder(GeoServerDigestPasswordEncoder.class);
        if (masterPasswdDigest == null) {
            synchronized (this) {
                if (masterPasswdDigest == null) {
                    try {
                        //look for file
                        masterPasswdDigest = loadMasterPasswordDigest();
                    }
                    catch(IOException e) {
                        throw new RuntimeException("Unable to create master password digest", e);
                    }
                }
            }
        }
        return pwEncoder.isPasswordValid(masterPasswdDigest, passwd, null);
    }
View Full Code Here


            fout.close();
        }
    }

    String computeAndSaveMasterPasswordDigest(char[] passwd) throws IOException {
        GeoServerDigestPasswordEncoder pwEncoder =
                loadPasswordEncoder(GeoServerDigestPasswordEncoder.class);
        String masterPasswdDigest = pwEncoder.encodePassword(passwd, null);
        saveMasterPasswordDigest(masterPasswdDigest);
        return masterPasswdDigest;
    }
View Full Code Here

        return emptyPwe;
    }
   
    protected GeoServerDigestPasswordEncoder createDigestPasswordEncoder(
        GeoServerSecurityManager secMgr) throws IOException {
        GeoServerDigestPasswordEncoder digestPwe = new GeoServerDigestPasswordEncoder();
        digestPwe.setBeanName("digestPasswordEncoder");
        digestPwe.setPrefix("digest1");
        return digestPwe;
    }
View Full Code Here

TOP

Related Classes of org.geoserver.security.password.GeoServerDigestPasswordEncoder

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.