When importing from a pem file (import_from_pem), the kid can be set or if not, it uses the thumbprint() by default.
Especially when the jwk is added to a jwks afterwards - and potentially multiple keys are in the jwks, a kid would be required to identify the right key.
|
self.__setitem__('kid', kid) |
Example workaround:
pub_jwk.import_from_pyca(pub_key)
pub_jwk['kid'] = pub_jwk.thumbprint()
jwks = JWKSet()
jwks.add(pub_jwk)
jwks_export = jwks.export(private_keys=False, as_dict=True)
Anything I'm doing wrong here?
Thanks,
Matthias