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

The Key Chain #2

Closed
richardschneider opened this issue Nov 23, 2017 · 5 comments
Closed

The Key Chain #2

richardschneider opened this issue Nov 23, 2017 · 5 comments

Comments

@richardschneider
Copy link
Owner

richardschneider commented Nov 23, 2017

The key store is used to manage asymmetrical keys. In particular, it holds the key used to encrypt/decrypt of the dag's DataKey.

It has a specification , API and an implementation in GO.

Key store commands are implemented GO.

@richardschneider
Copy link
Owner Author

A special key self is always available. It is the key used to identity the local peer node. It's multihash is the same as peer's ID.

ipfs key list -l

Qmei6fBYij8gjbetgHLXmoR54iRc9hioPR7dtmBTNG3oWa self
QmeLrUkPdmyXGUzP8AnBaR626mFyggWSSakSVsRVaaLLZA tmp

ipfs id

{
        "ID": "Qmei6fBYij8gjbetgHLXmoR54iRc9hioPR7dtmBTNG3oWa",
        "PublicKey": "CAASpgIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvxmCwAStFBFbsjkbokFRc3RN/OtzGdOEmMBlXewoFNu1RPtnzdUq/l5aNd2DD4pocDdSMV4GNNR1YxgqNyzNMxVC2nt+ziV4G/STMHx7XFWfVlRHiGMx/jm3m146x2PCtAnf+93EdihCEehdvz1zyNTwjGesO7XWAIC9tc7Qq9mYBe4tlY2a7a6SdBWwseAolNFMZkP9J0gdosjfFjcBEWmxwRxvTMTpCOuBv34KwiXQxzLEnby4GWtdvEgXrCMM9JLRlSSBlvqu+ro0MIejXk5lnRMr7hQRrjyqqMorntEXkoEYYXo663t5HxaIie3bjAC6nXouzfzntA/AEp7gzAgMBAAE=",
        "Addresses": [ ... ]
        "AgentVersion": "go-ipfs/0.4.11/",
        "ProtocolVersion": "ipfs/0.1.0"
}

@richardschneider
Copy link
Owner Author

richardschneider commented Nov 23, 2017

A key store must

This was referenced Nov 23, 2017
@richardschneider
Copy link
Owner Author

richardschneider commented Nov 25, 2017

An import/export mechanism for the key is required.

Export is to a single recipient (peer) and should only be readable by the recipient. Implies encrypting the exported key with recipient's public key.

@richardschneider
Copy link
Owner Author

richardschneider commented Nov 25, 2017

On second thought Sign/Verify/Encrypt/Decrypt is a messy interface to the key store consumer. I prefer something like

  • CreateAnonymousEncryptedData (encryptingKeyname, plain)
  • CreateSignedEncryptedData (encryptingKeyname, [signingKeyname], plain)
  • ReadECmsData (cipher)

where

  • encryptingKeyname cannot be self
  • signingKeyname defaults to self
  • self is the peer's private key

@richardschneider richardschneider changed the title The Key Store The Key Chain Dec 3, 2017
@richardschneider
Copy link
Owner Author

The key chain code is now at https://github.com/libp2p/js-libp2p-keychain

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

No branches or pull requests

1 participant