public abstract class AbstractGdprEncryption extends java.lang.Object implements GdprEncryption
GdprEncryption by only providing the
KeyManagement facilities.
This uses AES/GCM/NoPadding with an initialization vector created
from a SecureRandom.
Implementations must be thread-safe.
| Constructor and Description |
|---|
AbstractGdprEncryption(akka.actor.ExtendedActorSystem system) |
| Modifier and Type | Method and Description |
|---|---|
scala.concurrent.Future<scala.Option<byte[]>> |
decrypt(byte[] payload,
java.lang.String dataSubjectId)
Decrypt the given payload with the key identified by dataSubjectId.
|
scala.concurrent.Future<byte[]> |
encrypt(byte[] payload,
java.lang.String dataSubjectId)
Encrypt the given payload with the key identified by dataSubjectId.
|
static java.lang.String |
EncryptionMethod() |
GdprSettings |
gdprSettings() |
protected abstract KeyManagement |
keyManagement()
A
KeyManagement for creating and retrieving keys. |
protected java.security.SecureRandom |
secureRandom()
The
SecureRandom that is used for the initialization vectors of the encryption. |
scala.concurrent.Future<akka.Done> |
shred(java.lang.String dataSubjectId)
Remove the key identified by dataSubjectId from
KeyManagement. |
public AbstractGdprEncryption(akka.actor.ExtendedActorSystem system)
public static java.lang.String EncryptionMethod()
public GdprSettings gdprSettings()
protected java.security.SecureRandom secureRandom()
SecureRandom that is used for the initialization vectors of the encryption.
Subclass may override to define another implementation than the default.protected abstract KeyManagement keyManagement()
KeyManagement for creating and retrieving keys.public scala.concurrent.Future<byte[]> encrypt(byte[] payload,
java.lang.String dataSubjectId)
The key will be either created or retrieved using the KeyManagement
encrypt in interface GdprEncryptionpayload - (undocumented)dataSubjectId - (undocumented)public scala.concurrent.Future<scala.Option<byte[]>> decrypt(byte[] payload,
java.lang.String dataSubjectId)
The key will be retrieved using the KeyManagement
decrypt in interface GdprEncryptionpayload - (undocumented)dataSubjectId - (undocumented)public scala.concurrent.Future<akka.Done> shred(java.lang.String dataSubjectId)
KeyManagement.shred in interface GdprEncryptiondataSubjectId - (undocumented)