(data interface{})
| 760 | } |
| 761 | |
| 762 | func (s *sqlDatabase) marshalAndSeal(data interface{}) ([]byte, error) { |
| 763 | enc, err := json.Marshal(data) |
| 764 | if err != nil { |
| 765 | return nil, fmt.Errorf("error marshalling data: %w", err) |
| 766 | } |
| 767 | return util.Seal(enc, []byte(s.cfg.Passphrase)) |
| 768 | } |
| 769 | |
| 770 | func (s *sqlDatabase) unsealAndUnmarshal(data []byte, target interface{}) error { |
| 771 | decrypted, err := util.Unseal(data, []byte(s.cfg.Passphrase)) |