org.sonatype.plexus.components.cipher

## Class DefaultPlexusCipher

- java.lang.Object
- - org.sonatype.plexus.components.cipher.DefaultPlexusCipher

- All Implemented Interfaces:
    PlexusCipher

      @Named(value="default")
      @Typed(value=PlexusCipher.class)
      public class DefaultPlexusCipher
      extends Object
      implements PlexusCipher

  Author:
    Oleg Gusakov

- - ### Field Summary

    - ### Fields inherited from interface org.sonatype.plexus.components.cipher.PlexusCipher

      `ENCRYPTED_STRING_DECORATION_START, ENCRYPTED_STRING_DECORATION_STOP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPlexusCipher()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `decorate(String str)` decorated given string with { and }
    `String` | `decrypt(String str, String passPhrase)` decrypt given base64 encrypted string
    `String` | `decryptDecorated(String str, String passPhrase)` decrypt given base64 encoded encrypted string.
    `String` | `encrypt(String str, String passPhrase)` encrypt given string with the given passPhrase and encode it into base64
    `String` | `encryptAndDecorate(String str, String passPhrase)` encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorations
    `static String[]` | `getCryptoImpls(String serviceType)` This method returns the available implementations for a service type
    `static String[]` | `getServiceTypes()` Exploratory part.
    `boolean` | `isEncryptedString(String str)` check if given string is decorated
    `static void` | `main(String[] args)`
    `String` | `unDecorate(String str)` return string inside decorations

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultPlexusCipher

          public DefaultPlexusCipher()
                              throws PlexusCipherException

      Throws:
        `PlexusCipherException`

  - ### Method Detail

    - #### encrypt

          public String encrypt(String str,
                       String passPhrase)
                         throws PlexusCipherException

      Description copied from interface: `PlexusCipher`
      encrypt given string with the given passPhrase and encode it into base64
      Specified by:
        `encrypt` in interface `PlexusCipher`
      Returns:
      Throws:
        `PlexusCipherException`

    - #### encryptAndDecorate

          public String encryptAndDecorate(String str,
                                  String passPhrase)
                                    throws PlexusCipherException

      Description copied from interface: `PlexusCipher`
      encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorations
      Specified by:
        `encryptAndDecorate` in interface `PlexusCipher`
      Returns:
      Throws:
        `PlexusCipherException`

    - #### decrypt

          public String decrypt(String str,
                       String passPhrase)
                         throws PlexusCipherException

      Description copied from interface: `PlexusCipher`
      decrypt given base64 encrypted string
      Specified by:
        `decrypt` in interface `PlexusCipher`
      Returns:
      Throws:
        `PlexusCipherException`

    - #### decryptDecorated

          public String decryptDecorated(String str,
                                String passPhrase)
                                  throws PlexusCipherException

      Description copied from interface: `PlexusCipher`
      decrypt given base64 encoded encrypted string. If string is decorated, decrypt base64 encoded string inside decorations
      Specified by:
        `decryptDecorated` in interface `PlexusCipher`
      Returns:
      Throws:
        `PlexusCipherException`

    - #### isEncryptedString

          public boolean isEncryptedString(String str)

      Description copied from interface: `PlexusCipher`
      check if given string is decorated
      Specified by:
        `isEncryptedString` in interface `PlexusCipher`
      Returns:

    - #### unDecorate

          public String unDecorate(String str)
                            throws PlexusCipherException

      Description copied from interface: `PlexusCipher`
      return string inside decorations
      Specified by:
        `unDecorate` in interface `PlexusCipher`
      Returns:
      Throws:
        `PlexusCipherException`

    - #### decorate

          public String decorate(String str)

      Description copied from interface: `PlexusCipher`
      decorated given string with { and }
      Specified by:
        `decorate` in interface `PlexusCipher`
      Returns:

    - #### getServiceTypes

          public static String[] getServiceTypes()

      Exploratory part. This method returns all available services types

    - #### getCryptoImpls

          public static String[] getCryptoImpls(String serviceType)

      This method returns the available implementations for a service type

    - #### main

          public static void main(String[] args)

Copyright © 2015. All rights reserved.