Closed n0900 closed 3 months ago
seems legit. do we need something like that for COSE keys too? also API docs and tests need fixing, but we should go for this!
But won't this also add a keyId, when converting from a JWK to a CryptoPublicKey and then back again?
So if I understand you correctly, the conversion from JsonWebKey
(no keyId) to CryptoPublicKey
is adding a key ID, where none exists?
If so, why isn't that the issue to fix?
But won't this also add a keyId, when converting from a JWK to a CryptoPublicKey and then back again?
True, this will override a JWK kid if it was null to begin with. Not perfect.
So if I understand you correctly, the conversion from
JsonWebKey
(no keyId) toCryptoPublicKey
is adding a key ID, where none exists?If so, why isn't that the issue to fix?
Because if we fix it like that then no JsonWebKey we generate using our library will ever have a keyID, which might not be ideal
Maybe it should be possible to specify a keyId when converting to JsonWebKey
, then?
Maybe it should be possible to specify a keyId when converting to
JsonWebKey
, then?
we could lift the additional property from the jsonwebkey to a main property of the CryptoPublicKey itself, what do you think of the recent commit as a base? If this is okay I will extend it for JWK and COSE.
Obviously we would then need remove the additional property, instead we can move the JWK thumbprint as an additional property which then makes it easily accessable as it was/is quite flaky right now.
Better to squash all commits into one when merging? (-:
We squash merge anyway, no need to force push the PR branch... this just ends up making the CIs take even longer to finish.
When a JsonWebKey is created from a CryptopublicKey which in turn was created by a keyPair it does not have a keyId. However if we transform this JsonWebKey back to a CryptoPublicKey the identifier gets saved to keyId and if we then transform it back again to JsonWebKey it now has a keyid -> the previous identifier.
As an easy fix I propose this change, however other ideas are welcome.