Class CryptoHelper

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.messagingconnector.CryptoHelper
All Implemented Interfaces:
LogEnabled, Component

public class CryptoHelper extends AbstractLogEnabled implements Component
Helper to encrypt/decrypt some text
  • Field Details

    • ROLE

      public static final String ROLE
      Avalon Role
  • Constructor Details

  • Method Details

    • decrypt

      public String decrypt(String encryptedValue, String key)
      Decrypt a string (base64) using the selected key
      Parameters:
      encryptedValue - the encrypted value
      key - The key used to decrypt value
      Returns:
      the decrypted String
    • decrypt

      public String decrypt(String encryptedValue)
      Decrypt a string (base64) using the generated key
      Parameters:
      encryptedValue - the encrypted value
      Returns:
      the decrypted String
    • encrypt

      public String encrypt(String data, String key)
      Encrypt (base64) a string using the selected key
      Parameters:
      data - input data
      key - the key used to encrypt
      Returns:
      the base64 value of the encrypted data
    • encrypt

      public String encrypt(String data)
      Encrypt (base64) a string using the generated key
      Parameters:
      data - input data
      Returns:
      the base64 value of the encrypted data
    • getCryptoKey

      public String getCryptoKey()
      Get the generated crypto key
      Returns:
      the generated crypto key