web-payments / web-payments.org

Web Payments website and core specifications
https://web-payments.org/
29 stars 13 forks source link

Will the Key class be extended to handle public keys formatted as in the Linked Data Koblitz specification? #42

Closed kimdhamilton closed 7 years ago

kimdhamilton commented 7 years ago

The Key class allows PEM-encoded public keys (example from specification at the end). Do we envision this class being extended to handle public keys formatted as in the Linked Data Koblitz spec?

E.g. "creator": "ecdsa-koblitz-pubkey:..."

{
  "@context": "https://w3id.org/security/v1",
  "@id": "https://payswarm.example.com/i/bob/keys/1",
  "@type": "Key",
  "created": "2012-01-03T14:34:57+0000",
  "revoked": "2012-05-01T18:11:19+0000",
  "owner": "https://payswarm.example.com/i/bob",
  "publicKeyPem": "-----BEGIN PRIVATE KEY-----\nMIIBG0BA...OClDQAB\n-----END PRIVATE KEY-----\n",
}
msporny commented 7 years ago

Short answer: yes.

Longer answer:

The usage of Key and publicKey are defined in this vocabulary:

https://w3id.org/security

and the publicKey entry there:

https://w3id.org/security#publicKey

The interesting thing about Koblitz is that you can express the entire public key in the @id... you don't need a field like publicKeyPem. That said, if there was a standard PEM encoding for ECDSA Koblitz, then we could use publicKeyPem for that purpose.

No one has really looked into what the best standard encoding for Koblitz should be... but we have at least two options stated above... and we may want more in time.

Also... we really should move the security vocabulary from web-payments.org to the Digital Verification CG.

kimdhamilton commented 7 years ago

Thanks for the clarification @msporny.

To summarize with a modified example from https://w3id.org/security#publicKey, something like this could be used?

{
  "@context": "https://w3id.org/security/v1",
  "@id": "ecdsa-koblitz-pubkey:<value>",
  "@type": "Key",
  "created": "2012-01-03T14:34:57+0000",
  "expires": "2014-01-03T14:34:57+0000",
  "owner": "https://payswarm.example.com/i/bob",
}

Thanks again, and feel free to close (or I will close it)

msporny commented 7 years ago

Yep, you got it.

We may want to contemplate whether or not we want to explicitly specify the type:

"@type": ["Key", "EcdsaKoblitzKey"]

Just a thought, we don't need to do that any time soon.

Close the issue at your leisure (once you feel it's been resolved and you have no more questions).

kimdhamilton commented 7 years ago

Perfect! I'm out of questions for now, so closing it out