Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Key exchange #114

Closed
richardschneider opened this issue Dec 8, 2017 · 4 comments
Closed

Key exchange #114

richardschneider opened this issue Dec 8, 2017 · 4 comments

Comments

@richardschneider
Copy link
Contributor

Problem

As a key holder
I want to exchange the key with other systems
So that they can use the same key

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 8, 2017

Solution

Most other systems will accept a key in PKCS #8 or PCKS #12 format. Both formats allow encrypting with a password, which should be enforced.

PKCS #8 is a natural choice, because PKCS #12 requires a certificate which is not currently supported. PEM encoding (text not DER) is preferred.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 8, 2017

Design

  • Every private key class implements export ([format], password).
  • keys implements import (data, [format], password).

Where format defaults to pkcs-8.

This allows libp2p/js-libp2p-keychain#7 to create and save keys using this library.

@richardschneider
Copy link
Contributor Author

@diasdavid Have you looked at jsrassign. It has PKCS 7 and 8 support.

@daviddias
Copy link
Member

daviddias commented Dec 13, 2017

@richardschneider I never tried it out, but looks like it has what you need and it is CJS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants