richardschneider / ipfs-encryption

Encrypting IPFS data
MIT License
18 stars 4 forks source link

CMS: Recipient Info (ktri vs kekri) #18

Closed richardschneider closed 6 years ago

richardschneider commented 6 years ago

The current CMS RecipientInfo libp2p/js-libp2p-cms#1 uses the ktri KeyTransRecipientInfo, with the issuer's CN containing the key's id. IPFS doesn't have distinguished names and it's basically a hack to send the key's ID.

   recipientInfos:
      d.ktri:
        version: <ABSENT>
        d.issuerAndSerialNumber:
          issuer: O=ipfs, OU=keystore, CN=QmWc1hrWTsh1sWkCKn5hd5AvMD4ZhRFwEtok2MhCAzpuvx
          serialNumber: 1
        keyEncryptionAlgorithm:
          algorithm: rsaEncryption (1.2.840.113549.1.1.1)
          parameter: NULL
        encryptedKey: ...

The kekri KEKRecipientInfo is more suited to IPFS; it uses a key ID instead of a distinguished name. However, the spec does state that

Recipient information using previously distributed symmetric keys

richardschneider commented 6 years ago

Moved to https://github.com/libp2p/js-libp2p-cms/issues/1