public class AesProtectionService extends java.lang.Object implements IProtectionService
IProtectionService that uses the AES encryption to protect data.
The encryption requires a symmetric key, which is derived from a key source. The key source is retrieved using a IKeySourceProvider
implementation that is chosen by the code that uses this class, according to the respective requirements and conditions.| Constructor and Description |
|---|
AesProtectionService(IKeySourceProvider keySourceProvider)
Constructor to create an instance that uses a certain
IKeySourceProvider. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
protect(byte[] bytesToProtect)
Protects the given content in an appropriate way so that uprotection is only possible with a specific knowledge
or priviledge, depending on the implementation.
|
byte[] |
unprotect(byte[] protectedBytes)
Removes the protection from the given protected content.
|
public AesProtectionService(IKeySourceProvider keySourceProvider)
IKeySourceProvider.keySourceProvider - The IKeySourceProvider to retrieve the key source for the encryption and decryption.
The key source is processed by a key derivation function to fulfill the requirements of the algorithm
and to increase security.public byte[] protect(byte[] bytesToProtect)
throws ClientException
IProtectionServiceprotect in interface IProtectionServicebytesToProtect - The content to protect.ClientException - If the protection fails.public byte[] unprotect(byte[] protectedBytes)
throws ClientException
IProtectionServiceunprotect in interface IProtectionServiceprotectedBytes - The content to unprotect.ClientException - If the unprotection fails.