private String decrypt(String string, String password) { try { return cipher.decryptDecorated( string, password ); } catch (PlexusCipherException e) { log.warn( "Unable to decrypt Maven password using PlexusCipher", e ); return string; } } }
private String getMaster() throws SecDispatcherException { if (securitySettings == null) { throw new IllegalStateException( "Unable to get security configuration from " + securitySettingsPath.getPath() + "."); } String master = securitySettings.getMaster(); if (master == null) { throw new IllegalStateException("Security configuration from " + securitySettingsPath.getPath() + " does not contain master password"); } try { return cipher.decryptDecorated(master, DEFAULT_PASSPHRASE); } catch (PlexusCipherException e) { throw new SecDispatcherException(e); } } }
public String decrypt( String encodedPassword, String encoding ) throws PlexusCipherException { // check if the password is encrypted if ( !plexusCipher.isEncryptedString( encodedPassword ) ) { return encodedPassword; } if ( encodedPassword != null ) { return plexusCipher.decryptDecorated( encodedPassword, encoding ); } return null; } }
public String decrypt( String encodedPassword, String encoding ) throws PlexusCipherException { // check if the password is encrypted if ( !plexusCipher.isEncryptedString( encodedPassword ) ) { return encodedPassword; } if ( encodedPassword != null ) { return plexusCipher.decryptDecorated( encodedPassword, encoding ); } return null; } }
private String getMaster() throws SecDispatcherException, InvalidConfigurationFileException { if (securitySettings == null) { throw new InvalidConfigurationFileException( "Unable to get security configuration from " + securitySettingsPath.getPath() + ". Please define path to the settings-security.xml file via -D" + MavenSettingsBuilder.ALT_SECURITY_SETTINGS_XML_LOCATION + ", or put it the the default location defined by Maven."); } String master = securitySettings.getMaster(); if (master == null) { throw new InvalidConfigurationFileException("Security configuration from " + securitySettingsPath.getPath() + " does not contain master password"); } try { return cipher.decryptDecorated(master, DEFAULT_PASSPHRASE); } catch (PlexusCipherException e) { throw new SecDispatcherException(e); } } }
private String getMaster() throws SecDispatcherException, InvalidConfigurationFileException { if (securitySettings == null) { throw new InvalidConfigurationFileException( "Unable to get security configuration from " + securitySettingsPath.getPath() + ". Please define path to the settings-security.xml file via -D" + MavenSettingsBuilder.ALT_SECURITY_SETTINGS_XML_LOCATION + ", or put it the the default location defined by Maven."); } String master = securitySettings.getMaster(); if (master == null) { throw new InvalidConfigurationFileException("Security configuration from " + securitySettingsPath.getPath() + " does not contain master password"); } try { return cipher.decryptDecorated(master, DEFAULT_PASSPHRASE); } catch (PlexusCipherException e) { throw new SecDispatcherException(e); } } }
private String getMaster( SettingsSecurity sec ) throws SecDispatcherException { String master = sec.getMaster(); if( master == null ) throw new SecDispatcherException( "master password is not set" ); try { return _cipher.decryptDecorated( master, SYSTEM_PROPERTY_SEC_LOCATION ); } catch ( PlexusCipherException e ) { throw new SecDispatcherException(e); } } //---------------------------------------------------------------