A self hosted chat application with end-to-end encrypted messaging.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

  1. package org.ros.chatto.model;
  2. import javax.persistence.Entity;
  3. import javax.persistence.EntityListeners;
  4. import javax.persistence.GeneratedValue;
  5. import javax.persistence.GenerationType;
  6. import javax.persistence.Id;
  7. import javax.persistence.Table;
  8. import com.fasterxml.jackson.annotation.JsonProperty;
  9. import org.springframework.data.jpa.domain.support.AuditingEntityListener;
  10. import lombok.Data;
  11. /*Object { iv: "2rtnuXaJXFuQGO9ncaVkmA==", v: 1, iter: 10000, ks: 128, ts: 64, mode: "ccm", adata: "", cipher: "aes", salt: "H1z7o3f6qlQ=", ct: "lF9Uno7ihjVv01M8" }
  12. this is what the json will look like*/
  13. @Data
  14. @Entity
  15. @Table(name = "message_ciphers")
  16. @EntityListeners(AuditingEntityListener.class)
  17. // @JsonIgnoreProperties(value = { "id"}, allowGetters = false)
  18. public class MessageCipher {
  19. @Id
  20. @GeneratedValue(strategy = GenerationType.IDENTITY)
  21. private int id;
  22. private String iv;
  23. private int v;
  24. @JsonProperty("iter")
  25. private int iterations;
  26. @JsonProperty("ks")
  27. private int keySize;
  28. @JsonProperty("ts")
  29. private int tagSize;
  30. private String mode;
  31. private String adata;
  32. private String cipher;
  33. private String salt;
  34. @JsonProperty("ct")
  35. private String cipherText;
  36. }