SymmetricEncryption
Leave feedback
On this page
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).
| 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 |
| 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 |
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 |
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 |
public final int getAlgorithmType()
Gets or sets type of symmetric algorithm.
Returns: int
public final void setAlgorithmType(int value)
Gets or sets type of symmetric algorithm.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int |
public final String getKey()
Gets or sets key of encryption algorithm.
Returns: java.lang.String
public final void setKey(String value)
Gets or sets key of encryption algorithm.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String |
public final String getSalt()
Gets or sets passphrase of encryption algorithm.
Returns: java.lang.String
public final void setSalt(String value)
Gets or sets passphrase of encryption algorithm.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String |
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.
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.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.