This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per ipfs/kubo#4240 I thought I'd move toward the first steps here.
Exported key storage format
PrivKey
already has marshal/unmarshal. I don't know if these include a version number/are future proof/are frozen but PrivKey is a good target since everything else can be derived from it.Import
Since the serialized format is opaque Import takes a blob.
Export
Users might want to install ipfs, generate a key, and import it on another (remote?) machine without setting up ipfs locally. That said, I think there are two options here:
Key
or a new return type defined. I'm not sure what backward compatibility guarantees are here... I've seen some other libraries do things likeGenerate2
Generate3
to avoid breaking the interface.Generate
and crypto or something can provide a standalone function for creating keys from KeyGenerateOption, which can then be added withImport
. In that case onlyImport
is needed here I think.