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

Create the link between root keypair (kbpgp) and CA keypair (node-forge) #113

Closed
robert-cronin opened this issue Sep 30, 2020 · 2 comments
Closed
Assignees
Labels
development Standard development enhancement New feature or request

Comments

@robert-cronin
Copy link
Contributor

As per #94 (comment), there are a few options for doing this:

  1. Start with the root keypair and then use a KDF to generate the root x509 certificate pair.
  2. Start with the root x509 certificate pair, and then use a KDF to generate the root keypair
  3. Use the public-key of the root keypair as the actual public key of the x509 certificate
  4. Use the x509 certificate and private key AS the root keypair
@robert-cronin robert-cronin added enhancement New feature or request development Standard development labels Sep 30, 2020
@robert-cronin robert-cronin self-assigned this Sep 30, 2020
@robert-cronin
Copy link
Contributor Author

robert-cronin commented Nov 26, 2020

within node-forge, we can do something like this to make the x.509 certificate the one and only piece of sharing needed for peer to peer contact. For example the kbpgp public key and peerAddress can be encoded in the public cert via attributes:

const attrs = [
  {
    name: 'commonName',
    value: 'matrixai',
  },
  {
    // kbpgp public key
    type: '1.3.1.4.1',
    value: '<publicKey>'
  },
  {
    // peerAddress
    type: '1.3.1.4.2',
    value: '127.0.0.1:1314'
  }
];
certificate.setSubject(attrs);

where 1.3.1.4.1 and 1.3.1.4.2 are custom OIDs that we can use specifically for encoding polykey specific attributes and this works just fine in node-forge

@robert-cronin robert-cronin added this to the Polykey MVP 2 - Release Candidate milestone Dec 7, 2020
@robert-cronin
Copy link
Contributor Author

Closing on account of migration to gitlab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development enhancement New feature or request
Development

No branches or pull requests

1 participant