com.groupdocs.signature.domain.extensions.encryption

Class SymmetricEncryption

  • java.lang.Object
    • com.groupdocs.signature.domain.extensions.encryption.SymmetricEncryption
  • All Implemented Interfaces:
    IDataEncryption


    public final class SymmetricEncryption
    extends Object
    implements IDataEncryption

    Implements standard symmetric algorithms for data encryption with single key and passphrase (salt).

    • Constructor Detail

      • SymmetricEncryption

        public SymmetricEncryption(int algorithmType,
                                   String key)

        Creates symmetric encryption algorithm with default passphrase

        Parameters:
        algorithmType - Specify symmetric algorithm type
        key - Encryption key
      • SymmetricEncryption

        public SymmetricEncryption(int algorithmType,
                                   String key,
                                   String salt)

        Creates symmetric encryption algorithm with parameters.

        Parameters:
        algorithmType - Specify symmetric algorithm type
        key - Encryption key
        salt - Passphrase for encryption
    • Method Detail

      • decode

        public final String decode(String source)

        Decrypts string based on provided algorithm type, key and salt parameters

        Specified by:
        decode in interface IDataEncryption
        Parameters:
        source -
        Returns:
        Returns decrypted string.
      • encode

        public final String encode(String source)

        Encrypts string based on provided algorithm type, key and salt parameters

        Specified by:
        encode in interface IDataEncryption
        Parameters:
        source - Source string to encode.
        Returns:
        Returns encrypted string.
      • getAlgorithmType

        public final int getAlgorithmType()

        Gets or sets type of symmetric algorithm.

      • getKey

        public final String getKey()

        Gets or sets key of encryption algorithm.

      • getSalt

        public final String getSalt()

        Gets or sets passphrase of encryption algorithm.

      • setAlgorithmType

        public final void setAlgorithmType(int value)

        Gets or sets type of symmetric algorithm.

      • setKey

        public final void setKey(String value)

        Gets or sets key of encryption algorithm.

      • setSalt

        public final void setSalt(String value)

        Gets or sets passphrase of encryption algorithm.