package org.ros.chatto.model; import javax.persistence.Entity; import javax.persistence.EntityListeners; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonProperty; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import lombok.Data; /*Object { iv: "2rtnuXaJXFuQGO9ncaVkmA==", v: 1, iter: 10000, ks: 128, ts: 64, mode: "ccm", adata: "", cipher: "aes", salt: "H1z7o3f6qlQ=", ct: "lF9Uno7ihjVv01M8" } this is what the json will look like*/ @Data @Entity @Table(name = "message_ciphers") @EntityListeners(AuditingEntityListener.class) // @JsonIgnoreProperties(value = { "id"}, allowGetters = false) public class MessageCipher { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; private String iv; private int v; @JsonProperty("iter") private int iterations; @JsonProperty("ks") private int keySize; @JsonProperty("ts") private int tagSize; private String mode; private String adata; private String cipher; private String salt; @JsonProperty("ct") private String cipherText; }