Package org.sonatype.plexus.components.sec.dispatcher

Examples of org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException


        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);
View Full Code Here


        }

        try {
            return cipher.decryptDecorated(master, DEFAULT_PASSPHRASE);
        } catch (PlexusCipherException e) {
            throw new SecDispatcherException(e);
        }
    }
View Full Code Here

  @Override
  public String decrypt(String str, Map attributes, Map config) throws SecDispatcherException
  {
    NativeEncrypter encrypter = encrypterManager.findUsableEncrypter();
    if (encrypter == null)
      throw new SecDispatcherException("No native encrypters available for current platform.");
   
    getLogger().debug("Using native encrypter: " + encrypter);
   
    try
    {
      String password = encrypter.decrypt(str);
      return(password);
    }
    catch (EncryptionException e)
    {
      throw new SecDispatcherException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException

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.