Class DefaultPlexusCipher

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String decorate​(java.lang.String str)
      decorated given string with { and }
      java.lang.String decrypt​(java.lang.String str, java.lang.String passPhrase)
      decrypt given base64 encrypted string
      java.lang.String decryptDecorated​(java.lang.String str, java.lang.String passPhrase)
      decrypt given base64 encoded encrypted string.
      java.lang.String encrypt​(java.lang.String str, java.lang.String passPhrase)
      encrypt given string with the given passPhrase and encode it into base64
      java.lang.String encryptAndDecorate​(java.lang.String str, java.lang.String passPhrase)
      encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorations
      static java.lang.String[] getCryptoImpls​(java.lang.String serviceType)
      This method returns the available implementations for a service type
      static java.lang.String[] getServiceTypes()
      Exploratory part.
      boolean isEncryptedString​(java.lang.String str)
      check if given string is decorated
      static void main​(java.lang.String[] args)  
      java.lang.String unDecorate​(java.lang.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()
    • Method Detail

      • encrypt

        public java.lang.String encrypt​(java.lang.String str,
                                        java.lang.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
        Parameters:
        str - string to encrypt
        passPhrase - pass phrase
        Returns:
        encrypted str
        Throws:
        PlexusCipherException - if encryption fails
      • encryptAndDecorate

        public java.lang.String encryptAndDecorate​(java.lang.String str,
                                                   java.lang.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
        Parameters:
        str - string to encrypt
        passPhrase - pass phrase
        Returns:
        encrypted and decorated str
        Throws:
        PlexusCipherException - if encryption fails
      • decrypt

        public java.lang.String decrypt​(java.lang.String str,
                                        java.lang.String passPhrase)
                                 throws PlexusCipherException
        Description copied from interface: PlexusCipher
        decrypt given base64 encrypted string
        Specified by:
        decrypt in interface PlexusCipher
        Parameters:
        str - base64 encoded string
        passPhrase - pass phrase
        Returns:
        decrypted str
        Throws:
        PlexusCipherException - if decryption fails
      • decryptDecorated

        public java.lang.String decryptDecorated​(java.lang.String str,
                                                 java.lang.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
        Parameters:
        str - base64 encoded string
        passPhrase - pass phrase
        Returns:
        decrypted decorated str
        Throws:
        PlexusCipherException - if decryption fails
      • isEncryptedString

        public boolean isEncryptedString​(java.lang.String str)
        Description copied from interface: PlexusCipher
        check if given string is decorated
        Specified by:
        isEncryptedString in interface PlexusCipher
        Parameters:
        str - string to check
        Returns:
        true if string is encrypted
      • decorate

        public java.lang.String decorate​(java.lang.String str)
        Description copied from interface: PlexusCipher
        decorated given string with { and }
        Specified by:
        decorate in interface PlexusCipher
        Parameters:
        str - string to decorate
        Returns:
        decorated str
      • getServiceTypes

        public static java.lang.String[] getServiceTypes()
        Exploratory part. This method returns all available services types
      • getCryptoImpls

        public static java.lang.String[] getCryptoImpls​(java.lang.String serviceType)
        This method returns the available implementations for a service type
      • main

        public static void main​(java.lang.String[] args)