FiloSottile / age

A simple, modern and secure encryption tool (and Go library) with small explicit keys, no config options, and UNIX-style composability.
https://age-encryption.org
BSD 3-Clause "New" or "Revised" License
17.26k stars 506 forks source link

UX: Allow access to internal format for API usage #152

Closed IxDay closed 3 years ago

IxDay commented 4 years ago

What were you trying to do

I am building an ssh agent able to decrypt age files using the extension mechanism based on previous work from 42wim. In the code I am parsing the age header to detect what ssh key could be used for decryption (see code here)

What happened

The format code is stored in the internal directory making it not available externally. This forced me to copy the entire file in my repository. Would it be possible to move this to a globally available namespace, allowing program and libraries to parse the header?

str4d commented 3 years ago

The way in which agents will be supported by age and rage is the plugin system (I've recently merged plugin support into rage behind the unstable feature flag). At decryption time, a plugin is given every stanza in the header, and will be making its decisions there. So once age has plugin support, I expect there will be an exposed way to parse stanzas, without needing to expose parsing of the entire header.