Codota Logo
PlexusCipher
Code IndexAdd Codota to your IDE (free)

How to use
PlexusCipher
in
org.sonatype.plexus.components.cipher

Best Java code snippets using org.sonatype.plexus.components.cipher.PlexusCipher (Showing top 19 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.sonatype.nexus/nexus-configuration

  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;
  }
}
origin: org.sonatype.nexus/nexus-configuration

public String encrypt( String password, String encoding )
  throws PlexusCipherException
{
  // check if the password is encrypted
  if ( plexusCipher.isEncryptedString( password ) )
  {
    return password;
  }
  if ( password != null )
  {
    return plexusCipher.encryptAndDecorate( password, encoding );
  }
  return null;
}
origin: shrinkwrap/resolver

private boolean isEncryptedString(String str) {
  if (str == null) {
    return false;
  }
  return cipher.isEncryptedString(str);
}
origin: gradle.plugin.org.datlowe.maven-publish-auth/buildSrc

  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;
    }
  }
}
origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

@Override
public String decrypt(String str) throws SecDispatcherException {
  if (!isEncryptedString(str)) {
    return str;
  }
  String bare = null;
  try {
    bare = cipher.unDecorate(str);
  } catch (PlexusCipherException e1) {
    throw new SecDispatcherException(e1);
  }
  Map<String, String> attr = stripAttributes(bare);
  String res = null;
  if (attr == null || attr.get("type") == null) {
    String master = getMaster();
    try {
      res = cipher.decrypt(bare, master);
    } catch (PlexusCipherException e) {
      throw new SecDispatcherException("Unable to decrypt encrypted string", e);
    }
  }
  else {
    String type = (String) attr.get(TYPE_ATTR);
    throw new UnsupportedOperationException("Unable to lookup security dispatched of type " + type);
  }
  return res;
}
origin: org.sonatype.security/security-configuration

public String encrypt( String password, String encoding )
  throws PlexusCipherException
{
  if ( password != null )
  {
    return plexusCipher.encryptAndDecorate( password, encoding );
  }
  return null;
}
origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

private boolean isEncryptedString(String str) {
  if (str == null) {
    return false;
  }
  return cipher.isEncryptedString(str);
}
origin: io.fabric8/fabric-maven

  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);
    }
  }
}
origin: io.fabric8/fabric-maven

@Override
public String decrypt(String str) throws SecDispatcherException {
  if (!isEncryptedString(str)) {
    return str;
  }
  String bare = null;
  try {
    bare = cipher.unDecorate(str);
  } catch (PlexusCipherException e1) {
    throw new SecDispatcherException(e1);
  }
  Map<String, String> attr = stripAttributes(bare);
  String res = null;
  if (attr == null || attr.get("type") == null) {
    String master = getMaster();
    try {
      res = cipher.decrypt(bare, master);
    } catch (PlexusCipherException e) {
      throw new SecDispatcherException("Unable to decrypt encrypted string", e);
    }
  }
  else {
    String type = (String) attr.get(TYPE_ATTR);
    throw new UnsupportedOperationException("Unable to lookup security dispatched of type " + type);
  }
  return res;
}
origin: org.sonatype.security/security-configuration

  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;
  }
}
origin: org.sonatype.plexus/plexus-sec-dispatcher

private boolean isEncryptedString( String str )
{
  if( str == null )
    return false;
  return _cipher.isEncryptedString( str );
}
//----------------------------------------------------------------------------
origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven

  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);
    }
  }
}
origin: shrinkwrap/resolver

@Override
public String decrypt(String str) throws SecDispatcherException {
  if (!isEncryptedString(str)) {
    return str;
  }
  String bare = null;
  try {
    bare = cipher.unDecorate(str);
  } catch (PlexusCipherException e1) {
    throw new SecDispatcherException(e1);
  }
  Map<String, String> attr = stripAttributes(bare);
  String res = null;
  if (attr == null || attr.get("type") == null) {
    String master = getMaster();
    try {
      res = cipher.decrypt(bare, master);
    } catch (PlexusCipherException e) {
      throw new SecDispatcherException("Unable to decrypt encrypted string", e);
    }
  }
  else {
    String type = (String) attr.get(TYPE_ATTR);
    throw new UnsupportedOperationException("Unable to lookup security dispatched of type " + type);
  }
  return res;
}
origin: io.fabric8/fabric-maven

private boolean isEncryptedString(String str) {
  if (str == null) {
    return false;
  }
  return cipher.isEncryptedString(str);
}
origin: shrinkwrap/resolver

  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);
    }
  }
}
origin: org.sonatype.plexus/plexus-sec-dispatcher

bare = _cipher.unDecorate( str );
  res = _cipher.decrypt( bare, master );
origin: apache/maven-release

private boolean isEncryptedString( String str )
{
  return cipher.isEncryptedString( str );
}
origin: org.sonatype.plexus/plexus-sec-dispatcher

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);
  }
}
//---------------------------------------------------------------
origin: gradle.plugin.org.datlowe.maven-publish-auth/buildSrc

/**
 * Gets a {@link PasswordProcessor} instance for the given password.
 *
 * @param password The password to handle.
 * @return A processor for the given password.
 */
public static PasswordProcessor getInstance(String password) {
  PlexusCipher cipher = buildCipher();
  if ( cipher == null || !cipher.isEncryptedString( password ) ) {
    return new DefaultPasswordProcessor( password );
  }
  else {
    return new DecryptionProcessor( password, cipher );
  }
}
org.sonatype.plexus.components.cipherPlexusCipher

Most used methods

  • isEncryptedString
  • decryptDecorated
  • decrypt
  • unDecorate
  • encryptAndDecorate

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now