-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor KeyType #38
Comments
Alg/Curve isn't the right abstraction either, unfortunately, since it doesn't cover non-curve key types like RSA or Dilithium. For example, an RSA JWK would use the I would recommend we either stick to key type or create unique mappings of [alg, crv?, kty] which we can identify like JOSE does. Of course this raises the question of whether we're using JOSE for everything. If we are - no problem. If not then it doesn't make sense to use their mappings. |
@decentralgabe I was under the impression that Kotlin was doing that unique mappings of alg/kty here: Then the consumer could get at the alg/kty like so: https://github.com/TBD54566975/web5-kt/blob/main/crypto/src/main/kotlin/web5/sdk/crypto/Crypto.kt#L41-L46 Did you have something else in mind here? |
@amika-sq that abstraction isn't exactly right, since Similarly Secp256k1 is bound to a JWA (ES256K), so it does seem like it's chosen a JOSE approach. Secp256k1 can be used for ECDH as well, so keeping it as a 'signer' seems like the wrong abstraction here. I think something like this might make sense:
Tink has solved this but in a confusing way. Since they refer to key/algorithm pairs as key types. When using JOSE they differentiate key types. So to provide a concrete recommendation, I'd just mimic the abstraction JOSE has. |
Could you point me to where that is? Do you mean the Tink abstraction? |
The section JSON Web Signature and Encryption Algorithms |
We implement this as web5-rs/crates/crypto/src/lib.rs Line 27 in 807067e
|
^^ fine for now until we need to support keys that don't use ECC 😄 (no reqs yet but will be eventually with PQC) |
Alright I'm going to re-open this actually because |
KeyType is confusing. Use what Kotlin does and separate out Algorithm/Curve.
The text was updated successfully, but these errors were encountered: