SymmetricEncryption
Inheritance: java.lang.Object
All Implemented Interfaces: com.groupdocs.signature.domain.extensions.encryption.IDataEncryption
public final class SymmetricEncryption implements IDataEncryption
Implements standard symmetric algorithms for data encryption with single key and passphrase (salt).
Constructors
| Constructor | Description | 
|---|---|
| SymmetricEncryption(int algorithmType, String key, String salt) | Creates symmetric encryption algorithm with parameters. | 
| SymmetricEncryption(int algorithmType, String key) | Creates symmetric encryption algorithm with default passphrase | 
Methods
| Method | Description | 
|---|---|
| getAlgorithmType() | Gets or sets type of symmetric algorithm. | 
| setAlgorithmType(int value) | Gets or sets type of symmetric algorithm. | 
| getKey() | Gets or sets key of encryption algorithm. | 
| setKey(String value) | Gets or sets key of encryption algorithm. | 
| getSalt() | Gets or sets passphrase of encryption algorithm. | 
| setSalt(String value) | Gets or sets passphrase of encryption algorithm. | 
| encode(String source) | Encrypts string based on provided algorithm type, key and salt parameters | 
| decode(String source) | Decrypts string based on provided algorithm type, key and salt parameters | 
SymmetricEncryption(int algorithmType, String key, String salt)
public SymmetricEncryption(int algorithmType, String key, String salt)
Creates symmetric encryption algorithm with parameters.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| algorithmType | int | Specify symmetric algorithm type | 
| key | java.lang.String | Encryption key | 
| salt | java.lang.String | Passphrase for encryption | 
SymmetricEncryption(int algorithmType, String key)
public SymmetricEncryption(int algorithmType, String key)
Creates symmetric encryption algorithm with default passphrase
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| algorithmType | int | Specify symmetric algorithm type | 
| key | java.lang.String | Encryption key | 
getAlgorithmType()
public final int getAlgorithmType()
Gets or sets type of symmetric algorithm.
Returns: int
setAlgorithmType(int value)
public final void setAlgorithmType(int value)
Gets or sets type of symmetric algorithm.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| value | int | 
getKey()
public final String getKey()
Gets or sets key of encryption algorithm.
Returns: java.lang.String
setKey(String value)
public final void setKey(String value)
Gets or sets key of encryption algorithm.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| value | java.lang.String | 
getSalt()
public final String getSalt()
Gets or sets passphrase of encryption algorithm.
Returns: java.lang.String
setSalt(String value)
public final void setSalt(String value)
Gets or sets passphrase of encryption algorithm.
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| value | java.lang.String | 
encode(String source)
public final String encode(String source)
Encrypts string based on provided algorithm type, key and salt parameters
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| source | java.lang.String | Source string to encode. | 
Returns: java.lang.String - Returns encrypted string.
decode(String source)
public final String decode(String source)
Decrypts string based on provided algorithm type, key and salt parameters
Parameters:
| Parameter | Type | Description | 
|---|---|---|
| source | java.lang.String | Encrypted string to decode. | 
Returns: java.lang.String - Returns decrypted string.