Open matgnt opened 1 year ago
I do not understand what the question is. The code will set the thumbprint() as the 'kid' if an explicit kid is not provided to import_from_pem().
But in your example you are calling import_from_pyca() which is a different function ...
When importing from raw keys thre is no automatic setting of the 'kid' parameter.
Is this a feature request to add a kid=None parameter to import_from_pyca(), and automatically set kid to self.thumbprint() when kid is not explicitly provided?
Is this a feature request to add a kid=None parameter to import_from_pyca(), and automatically set kid to self.thumbprint() when kid is not explicitly provided?
Yes, correct.
Because I used the pem import first, I was confused why I didn't see the kid
in my JWKS exports when I changed code to import from pyca.
When importing from a pem file (
import_from_pem
), thekid
can be set or if not, it uses thethumbprint()
by default. Especially when thejwk
is added to ajwks
afterwards - and potentially multiple keys are in thejwks
, akid
would be required to identify the right key.https://github.com/latchset/jwcrypto/blob/41fb08a00ad2a36a1d85bf77ad973b31144ef9f2/jwcrypto/jwk.py#L1012
Example workaround:
Anything I'm doing wrong here? Thanks, Matthias