Interface PlexusCipher

All Known Implementing Classes:
DefaultPlexusCipher

public interface PlexusCipher
  • Field Details

    • ENCRYPTED_STRING_DECORATION_START

      static final char ENCRYPTED_STRING_DECORATION_START
      See Also:
    • ENCRYPTED_STRING_DECORATION_STOP

      static final char ENCRYPTED_STRING_DECORATION_STOP
      See Also:
  • Method Details

    • encrypt

      String encrypt(String str, String passPhrase) throws PlexusCipherException
      encrypt given string with the given passPhrase and encode it into base64
      Parameters:
      str - string to encrypt
      passPhrase - pass phrase
      Returns:
      encrypted str
      Throws:
      PlexusCipherException - if encryption fails
    • encryptAndDecorate

      String encryptAndDecorate(String str, String passPhrase) throws PlexusCipherException
      encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorations
      Parameters:
      str - string to encrypt
      passPhrase - pass phrase
      Returns:
      encrypted and decorated str
      Throws:
      PlexusCipherException - if encryption fails
    • decrypt

      String decrypt(String str, String passPhrase) throws PlexusCipherException
      decrypt given base64 encrypted string
      Parameters:
      str - base64 encoded string
      passPhrase - pass phrase
      Returns:
      decrypted str
      Throws:
      PlexusCipherException - if decryption fails
    • decryptDecorated

      String decryptDecorated(String str, String passPhrase) throws PlexusCipherException
      decrypt given base64 encoded encrypted string. If string is decorated, decrypt base64 encoded string inside decorations
      Parameters:
      str - base64 encoded string
      passPhrase - pass phrase
      Returns:
      decrypted decorated str
      Throws:
      PlexusCipherException - if decryption fails
    • isEncryptedString

      boolean isEncryptedString(String str)
      check if given string is decorated
      Parameters:
      str - string to check
      Returns:
      true if string is encrypted
    • unDecorate

      String unDecorate(String str) throws PlexusCipherException
      return string inside decorations
      Parameters:
      str - decorated string
      Returns:
      undecorated str
      Throws:
      PlexusCipherException - if decryption fails
    • decorate

      String decorate(String str)
      decorated given string with { and }
      Parameters:
      str - string to decorate
      Returns:
      decorated str