Examples of EncryptedProperties


Examples of fr.valhalla.mailcheck.utils.EncryptedProperties

    private void startCheckers() {
        // Password entered
        if ((masterpassword != null) && (masterpassword.length() > 0)) {
            try {
                EncryptedProperties props = new EncryptedProperties(masterpassword);
                try {
                    FileInputStream in = new FileInputStream("fr.valhalla.mailcheck.accounts.properties");
                    props.load(in);
                    in.close();
                } catch (FileNotFoundException e) {
                    // Le fichier n'existe pas : on le crée
                    try {
                        props.store(new FileOutputStream(new File("fr.valhalla.mailcheck.accounts.properties")), null);
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
                Iterator i = props.keySet().iterator();
                while (i.hasNext()) {
                    String key = (String) i.next();
                    if (key.substring(0, 4) == null ? "acco" == null : key.substring(0, 4).equals("acco")) {
                        String accountName = props.getProperty(key);
                        // LANCEMENT DU CHECKER ICI
                        Checker c = new Checker(new Account(accountName, masterpassword), this);
                        if(gui) accountList.getContentPane().add(c.getCheckPanel());
                        c.start();
                        checkers.add(c);
View Full Code Here

Examples of fr.valhalla.mailcheck.utils.EncryptedProperties

    /**
     * Méthode utilisée par tous les constructeurs
     */
    public void init() {
        try {
            props = new EncryptedProperties(masterpassword);
        } catch(Exception e) { e.printStackTrace(); }
        // On essaie de charger les properties
        try {
            FileInputStream in = new FileInputStream("fr.valhalla.mailcheck.accounts.properties");
            props.load(in);
View Full Code Here

Examples of org.owasp.esapi.EncryptedProperties

    public void loadProperties(String encryptedPropertiesFilename,
                                  Properties props )
        throws IOException
    {
         EncryptedProperties loader = new DefaultEncryptedProperties();
         loader.load( new FileInputStream(
                                    new File( encryptedPropertiesFilename) ) );

         System.out.println("\n\nLoaded encrypted properties file...");

         try {
             props.setProperty( "database.driver",
                                loader.getProperty( "database.driver" ) );
             props.setProperty( "jdbc.url",
                                loader.getProperty( "jdbc.url" ) );
             props.setProperty( "jdbc.username",
                                loader.getProperty( "jdbc.username" ) );
             props.setProperty( "jdbc.password",
                                loader.getProperty( "jdbc.password" ) );
         } catch( EncryptionException ee ) {
             ee.printStackTrace();
         }
    }
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.