richardschneider / ipfs-encryption

Encrypting IPFS data
MIT License
18 stars 4 forks source link

Key ID #16

Closed richardschneider closed 6 years ago

richardschneider commented 6 years ago

The key ID should use the same encoding as an IPFS peer ID. This allows the peer's key to be imported as self in the keystore and allow's automated decrypting of data when a recipient is the peer's ID.

richardschneider commented 6 years ago

https://github.com/libp2p/js-peer-id

A Peer ID is the SHA-256 multihash of a public key.

The public key is a protobuf encoding containing a type and the DER encoding of the PKCS SubjectPublicKeyInfo