public abstract class AbstractGdprEncryption extends GdprEncryption
GdprEncryption by only providing the
KeyManagement facilities.
This uses AES/GCM/NoPadding with an initialization vector created
from a SecureRandom
| Constructor and Description |
|---|
AbstractGdprEncryption(akka.actor.ExtendedActorSystem system) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<java.util.Optional<byte[]>> |
decrypt(byte[] payload,
java.lang.String dataSubjectId)
Decrypt the given payload with the key identified by dataSubjectId.
|
java.util.concurrent.CompletionStage<byte[]> |
encrypt(byte[] payload,
java.lang.String dataSubjectId)
Encrypt the given payload with the key identified by dataSubjectId.
|
static java.lang.String |
EncryptionMethod() |
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. |
java.util.concurrent.CompletionStage<akka.Done> |
shred(java.lang.String dataSubjectId)
Remove the key identified by dataSubjectId from
KeyManagement. |
apply, createExtension, equals, get, hashCode, lookuppublic AbstractGdprEncryption(akka.actor.ExtendedActorSystem system)
public static java.lang.String EncryptionMethod()
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 java.util.concurrent.CompletionStage<byte[]> encrypt(byte[] payload,
java.lang.String dataSubjectId)
The key will be either created or retrieved using the KeyManagement
encrypt in class GdprEncryptionpayload - (undocumented)dataSubjectId - (undocumented)public java.util.concurrent.CompletionStage<java.util.Optional<byte[]>> decrypt(byte[] payload,
java.lang.String dataSubjectId)
The key will be retrieved using the KeyManagement
decrypt in class GdprEncryptionpayload - (undocumented)dataSubjectId - (undocumented)Optional.empty if the key has been deletedpublic java.util.concurrent.CompletionStage<akka.Done> shred(java.lang.String dataSubjectId)
KeyManagement.shred in class GdprEncryptiondataSubjectId - (undocumented)