Skip to content

age: add ExtractHeader, DecryptHeader, and NewInjectedFileKeyIdentity#631

Closed
FiloSottile wants to merge 1 commit into
mainfrom
filippo/detached
Closed

age: add ExtractHeader, DecryptHeader, and NewInjectedFileKeyIdentity#631
FiloSottile wants to merge 1 commit into
mainfrom
filippo/detached

Conversation

@FiloSottile

Copy link
Copy Markdown
Owner

No description provided.

@AnomalRoil AnomalRoil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a nice addition that will make using it as a library a little bit easier as well, I'm guessing the goal is to allow to have detached headers to have files with just ciphertext and no headers?

Comment thread age.go
Comment thread age.go
Comment on lines +317 to +325
type injectedFileKeyIdentity struct {
fileKey []byte
}

// NewInjectedFileKeyIdentity returns an [Identity] that always produces
// a fixed file key, such as one returned by [DecryptHeader].
func NewInjectedFileKeyIdentity(fileKey []byte) Identity {
return injectedFileKeyIdentity{fileKey}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name isn't immediately clear imo, maybe fixedFileKeyIdentity would be clearer?

Comment thread age.go
@FiloSottile

Copy link
Copy Markdown
Owner Author

Merged!

@FiloSottile FiloSottile closed this Dec 7, 2025
@FiloSottile FiloSottile deleted the filippo/detached branch December 7, 2025 19:10
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.

3 participants