DefaultPlexusCipher cipher = new DefaultPlexusCipher(); DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); System.out.println( cipher.encryptAndDecorate( passwd, masterPasswd ) );
public MavenSecDispatcher() { try { _cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { throw new RuntimeException(e); } } }
public MavenSecDispatcher() { _configurationFile = "~/.m2/settings-security.xml"; try { _cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { LOGGER.error("Error creating sec dispatcher"); } } }
private static PlexusCipher buildCipher() { try { return new DefaultPlexusCipher(); } catch (PlexusCipherException e) { log.error( "Unable to create PlexusCipher in order to decrypt Maven passwords" ); return null; } }
public MavenSecDispatcher() { _configurationFile = "~/.m2/settings-security.xml"; try { _cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { LOGGER.error("Error creating sec dispatcher"); } } }
SpringBootSecDispatcher() { File file = new File(MavenSettingsReader.this.homeDir, SECURITY_XML); this._configurationFile = file.getAbsolutePath(); try { this._cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { throw new IllegalStateException(e); } }
SpringBootSecDispatcher() { File file = getSettingsSecurityFile(); this._configurationFile = file.getAbsolutePath(); try { this._cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { throw new IllegalStateException(e); } } }
SpringBootSecDispatcher() { File file = new File(MavenSettingsReader.this.homeDir, SECURITY_XML); this._configurationFile = file.getAbsolutePath(); try { this._cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException ex) { throw new IllegalStateException(ex); } }
SpringBootSecDispatcher() { File file = new File(MavenSettingsReader.this.homeDir, SECURITY_XML); this._configurationFile = file.getAbsolutePath(); try { this._cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { throw new IllegalStateException(e); } }
SpringBootSecDispatcher() { File file = new File(MavenSettingsReader.this.homeDir, SECURITY_XML); this._configurationFile = file.getAbsolutePath(); try { this._cipher = new DefaultPlexusCipher(); } catch (PlexusCipherException e) { throw new IllegalStateException(e); } }
private static String decodePassword(final String encodedPassword, final String key) throws PlexusCipherException { final DefaultPlexusCipher cipher = new DefaultPlexusCipher(); return cipher.decryptDecorated(encodedPassword, key); }
private static String decodePassword(String encodedPassword, String key) throws PlexusCipherException { DefaultPlexusCipher cipher = new DefaultPlexusCipher(); return cipher.decryptDecorated(encodedPassword, key); }
private static void show( boolean showMaster ) throws Exception { if( showMaster ) System.out.print("\nsettings master password\n"); else System.out.print("\nsettings server password\n"); System.out.print("enter password: "); BufferedReader r = new BufferedReader( new InputStreamReader( System.in ) ); String pass = r.readLine(); System.out.println("\n"); DefaultPlexusCipher dc = new DefaultPlexusCipher(); DefaultSecDispatcher dd = new DefaultSecDispatcher(); dd._cipher = dc; if( showMaster ) System.out.println( dc.encryptAndDecorate( pass, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ) ); else { SettingsSecurity sec = dd.getSec(); System.out.println( dc.encryptAndDecorate( pass, dd.getMaster(sec) ) ); } } //---------------------------------------------------------------
private String encryptAndDecorate( String passwd ) throws IllegalStateException, SecDispatcherException, PlexusCipherException { String configurationFile = secDispatcher.getConfigurationFile(); if ( configurationFile.startsWith( "~" ) ) { configurationFile = System.getProperty( "user.home" ) + configurationFile.substring( 1 ); } String file = System.getProperty( DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION, configurationFile ); String master = null; SettingsSecurity sec = SecUtil.read( file, true ); if ( sec != null ) { master = sec.getMaster(); } if ( master == null ) { throw new IllegalStateException( "Master password is not set in the setting security file: " + file ); } DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); return cipher.encryptAndDecorate( passwd, masterPasswd ); }
DefaultPlexusCipher cipher = new DefaultPlexusCipher(); DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); System.out.println( cipher.encryptAndDecorate( passwd, masterPasswd ) );
DefaultPlexusCipher cipher = new DefaultPlexusCipher(); DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); cliRequest.stdout.println( cipher.encryptAndDecorate( passwd, masterPasswd ) );
DefaultPlexusCipher cipher = new DefaultPlexusCipher(); DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); cliRequest.stdout.println( cipher.encryptAndDecorate( passwd, masterPasswd ) );
DefaultPlexusCipher cipher = new DefaultPlexusCipher(); DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); System.out.println( cipher.encryptAndDecorate( passwd, masterPasswd ) );
@Override final public Object execute() throws Exception { Configuration c = cm.getConfiguration(PID); if (c != null && c.getProperties() != null) { try { cipher = new DefaultPlexusCipher(); securitySettings = securitySettings((String) c.getProperties().get(PID + "." + PROPERTY_SECURITY_FILE)); if (securitySettings != null && securitySettings.value != null) { mavenSecuritySettings = readSecuritySettings(securitySettings.value); } settings = settings((String) c.getProperties().get(PID + "." + PROPERTY_SETTINGS_FILE)); if (settings != null && settings.value != null) { mavenSettings = readSettings(settings.value); } localRepository = localRepository((String) c.getProperties().get(PID + "." + PROPERTY_LOCAL_REPOSITORY)); if (showPasswords()) { decryptSettings(); } doAction(PID + ".", c.getProperties()); } catch (Exception e) { System.err.println(e.getMessage()); LOG.error(e.getMessage(), e); } } else { System.err.printf("Can't access \"%s\" configuration\n", PID); } return null; }
private String encryptAndDecorate( String passwd ) throws IllegalStateException, SecDispatcherException, PlexusCipherException { String configurationFile = secDispatcher.getConfigurationFile(); if ( configurationFile.startsWith( "~" ) ) { configurationFile = System.getProperty( "user.home" ) + configurationFile.substring( 1 ); } String file = System.getProperty( DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION, configurationFile ); String master = null; SettingsSecurity sec = SecUtil.read( file, true ); if ( sec != null ) { master = sec.getMaster(); } if ( master == null ) { throw new IllegalStateException( "Master password is not set in the setting security file: " + file ); } DefaultPlexusCipher cipher = new DefaultPlexusCipher(); String masterPasswd = cipher.decryptDecorated( master, DefaultSecDispatcher.SYSTEM_PROPERTY_SEC_LOCATION ); return cipher.encryptAndDecorate( passwd, masterPasswd ); }