Interface EncryptedData.Encrypter

  • Enclosing class:
    EncryptedData

    public static interface EncryptedData.Encrypter
    Encrypts some data.
    • 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 the keyId and the data byte 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.