Package org.fuin.ddd4j.ddd
Interface EncryptedData.Encrypter
-
- Enclosing class:
- EncryptedData
public static interface EncryptedData.EncrypterEncrypts some data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EncryptedDataencrypt(@NotEmpty String keyId, @NotEmpty String dataType, @NotEmpty String contentType, @javax.validation.constraints.NotEmpty byte[] data)Encrypts some data using a dedicated key.
-
-
-
Method Detail
-
encrypt
EncryptedData encrypt(@NotEmpty @NotEmpty String keyId, @NotEmpty @NotEmpty String dataType, @NotEmpty @NotEmpty String contentType, @NotEmpty @javax.validation.constraints.NotEmpty byte[] data) throws EncryptionKeyIdUnknownException
Encrypts some data using a dedicated key. The encrypter will use the latest available version of key and initialization vector. The only arguments used actively for encryption are thekeyIdand thedatabyte array. The rest of the arguments is only stored for information purposes in the resulting data structure.- Parameters:
keyId- Unique identifier of a key to use.dataType- Unique type of the data like "UserPersonalData" or even a fully qualified class name.contentType- Content type like "application/json; encoding=UTF-8; version=1".data- Data to encrypt.- Returns:
- Encrypted data.
- Throws:
EncryptionKeyIdUnknownException- The given key identifier is unknown.
-
-