-
-
Notifications
You must be signed in to change notification settings - Fork 575
Add EncryptReader #646
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
base: main
Are you sure you want to change the base?
Add EncryptReader #646
Conversation
bf2ee21
to
0962d50
Compare
Add EncryptReader function to encrypt io.Reader (pull-based encryption) and use it in command to get rid of io.Copy. Updates FiloSottile#644 Signed-off-by: Alexander Yastrebov <[email protected]>
0962d50
to
f53ab87
Compare
This PR is nice and we need it, would it make sense to add this? func EncryptStream(src io.Reader, recipients ... Recipient) (dst io.Reader, error) {
pr, pw := io.Pipe()
return pr, EncryptReader(pw, src, recipients...)
} We wrap it currently as: https://gitlab.com/data-custodian/custodian/-/blob/88e7389ec5b837672f2b76fd82aaed68a4145e72/components/lib-common/pkg/crypto/reader.go |
I think this won't work as writes to pipe will block without corresponding reads. |
This PR adds a handy function but what you are looking for is the implementation of #644 |
Add EncryptReader function to encrypt io.Reader (pull-based encryption) and use it in cmd/age to get rid of io.Copy.
Updates #644