Package com.eviware.soapui.config

Examples of com.eviware.soapui.config.SoapuiSettingsDocumentConfig


      if( !file.canWrite() )
      {
        file = new File( new File( System.getProperty( "user.home", "." ) ), DEFAULT_SETTINGS_FILE );
      }

      SoapuiSettingsDocumentConfig settingsDocument = ( SoapuiSettingsDocumentConfig )this.settingsDocument.copy();
      String password = settings.getString( SecuritySettings.SHADOW_PASSWORD, null );

      if( password != null && password.length() > 0 )
      {
        try
        {
          byte[] data = settingsDocument.xmlText().getBytes();
          byte[] encryptedData = OpenSSL.encrypt( "des3", password.toCharArray(), data );
          settingsDocument.setSoapuiSettings( null );
          settingsDocument.getSoapuiSettings().setEncryptedContent( encryptedData );
        }
        catch( UnsupportedEncodingException e )
        {
          log.error( "Encryption error", e );
        }
        catch( IOException e )
        {
          log.error( "Encryption error", e );
        }
        catch( GeneralSecurityException e )
        {
          log.error( "Encryption error", e );
        }
      }

      FileOutputStream out = new FileOutputStream( file );
      settingsDocument.save( out );
      out.flush();
      out.close();
      log.info( "Settings saved to [" + file.getAbsolutePath() + "]" );
      lastSettingsLoad = file.lastModified();
      return file.getAbsolutePath();
View Full Code Here


            File file = new File(settingsFile);
            if (!file.canWrite()) {
                file = new File(new File(System.getProperty("user.home", ".")), DEFAULT_SETTINGS_FILE);
            }

            SoapuiSettingsDocumentConfig settingsDocument = (SoapuiSettingsDocumentConfig) this.settingsDocument.copy();
            String password = settings.getString(SecuritySettings.SHADOW_PASSWORD, null);

            if (password != null && password.length() > 0) {
                try {
                    byte[] data = settingsDocument.xmlText().getBytes();
                    String encryptionAlgorithm = "des3";
                    byte[] encryptedData = OpenSSL.encrypt(encryptionAlgorithm, password.toCharArray(), data);
                    settingsDocument.setSoapuiSettings(null);
                    settingsDocument.getSoapuiSettings().setEncryptedContent(encryptedData);
                    settingsDocument.getSoapuiSettings().setEncryptedContentAlgorithm(encryptionAlgorithm);
                } catch (UnsupportedEncodingException e) {
                    log.error("Encryption error", e);
                } catch (IOException e) {
                    log.error("Encryption error", e);
                } catch (GeneralSecurityException e) {
                    log.error("Encryption error", e);
                }
            }

            FileOutputStream out = new FileOutputStream(file);
            settingsDocument.save(out);
            out.flush();
            out.close();
            log.info("Settings saved to [" + file.getAbsolutePath() + "]");
            lastSettingsLoad = file.lastModified();
            return file.getAbsolutePath();
View Full Code Here

TOP

Related Classes of com.eviware.soapui.config.SoapuiSettingsDocumentConfig

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.