Skip to content

Shouldn't jwk.import_from_pyca also provide a kid param and set it to thumbprint() by default? #332

@matgnt

Description

@matgnt

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions