I'm working on implementing a plugin to handle files encrypted with Ansible Vault (https://docs.ansible.com/ansible/playbooks_vault.html). This has been asked for by others, for example (https://github.com/vermut/intellij-ansible/issues/33). The underlying files (once decrypted) are plain YAML, and in fact the repository of that GitHub issue is a plugin to handle Ansible/YAML files.
Ideally the behavior I'd like is when you click on an encrypted file it decrypts, and then parses and treats it like a YAML file (for example using the YamlFileType in the plugin mentioned). Similarly whenever the contents are saved the Element tree would convert to a text string, get encrypted, and then the encrypted string be written out.
I have Java code to do (en/de)cryption, and have been playing with creating my own VaultFileType, VaultParserDefinition, VaultParser, etc. My thinking was in the parse() method I would do the decryption, then pass it down to the YamlParser? I'm not sure if that's the right place though and how to make that work. On the write/encryption side I'm also not clear where to inject the right code.