Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --inspect flag #501

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jamespwilliams
Copy link

Fixes #56.

$ cat recipients.txt
age1lz0vhyg9y3k880cqscuh4hyfv0xdl7qnjqrlcz8euxc4a5d6eagsjhl6vc
age17hxnhlkq9ewhq594s3jf8c2e36n7gfg5mvefn0f3jqsfk76m6geszmywxr
age1ll9j2fr6nsdzmnqwk8qru9nx20sj264978jwswpnwq0nwnj4ayrsyugyqx
age160amxp02vl8w5e4z5tvvcmpdtjhdzkh20s3r9gqtzwufgyucreyqm6vw0y
age1xlauzza8tgn6l7e3ympwkps8tnt9psmpjj6jl0qfnfwkxkn7l4ws3s9xar

$ echo 'Hello age' | go run ./cmd/age -a -R recipients.txt -o encrypted.age.ascii

$ go run ./cmd/age --inspect encrypted.age.ascii | jq .
{
  "RecipientCounts": {
    "X25519": 5
  },
  "Version": "age-encryption.org/v1",
  "PayloadSize": 42
}

I've chosen to make the output JSON-encoded because the data that --inspect outputs is fairly small, so the JSON is fairly easily readable (even without jq), and outputting in JSON makes it machine-readable.

I've read https://github.com/FiloSottile/age/blob/9f0a2d25ac79da8100d68f3e8b3a1a57ea4a73ba/.github/CONTRIBUTING.md and can confirm that I won't be offended if this is reimplemented instead of being merged 😄

@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@jamespwilliams jamespwilliams temporarily deployed to Build, sign, release binaries April 30, 2023 14:48 — with GitHub Actions Inactive
@digtail
Copy link

digtail commented Jul 6, 2023

Thank you for writing this. I used this feature to test some tooling that uses age, and it came in very handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inspect encrypted file details
2 participants