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
x/crypto/openpgp: is there an opposite of (*Entity).SerializePrivate? #31899
Comments
@Merovius, I dont think so, I'm just trying to remove a private entity from a file. |
@WestleyK I'm afraid I don't really understand what you mean, then, by "removing a private entity from a file". What kind of file? A keyring? A serialized key packet - i.e. the output of AIUI, you can remove a private keys from a serialized key packet by a) reading the file in (using |
@Merovius, yes, a keyring. I want to do the equivalent of |
Disclaimer: All of this is to the best of my knowledge. So far, the keyring-handling of the openpgp packages is very minimal. In particular, I'm not sure it's possible to write out even a V1 keyring, which would be necessary for this. AIUI it's just a concatenated list of entities, so you might get by by calling Personally, I think a package to handle keyrings (V1 and/or V2) better would be great and making this easier would likely be part of that. However, I don't really see that happen any time soon. It's also probably best realized as a separate package and so it can be prototyped in a third-party repo first, if anyone wants to take a stab at it. So, ISTM: No, currently there is nothing like that and personally I think it's not a good idea to add this without a larger effort to improve keyring-handling in general. But someone else might well disagree :) |
Okay, thanks for your time! So right now its not possible to remove a private key from a keyring (like gpg), I do think that would be a nice feature to add. My question did get answered. So, feel free to close this issue or leave it open as a feature request 👍 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yeah, I think so.
What operating system and processor architecture are you using (
go env
)?go env
OutputJust a question: Is there a function to do the opposite of:
For a private key? Like to remove a private key entity from a file?
The text was updated successfully, but these errors were encountered: